Fix compiler warnings.
Changed Predicate into an interface and moved the composition methods onto a dedicated class to make it Java 8 lambda friendly.