Rohit Jain said
True, but those anonymous inner classes are actually subclass of WaterLevel and ChlorineLevel respectively. You've to have those classes.
This lead to me to realize that I have to define an interface for each anonymous inner class that I'm using. Just wanted to post this so that it's obvious this is solved.