public static Predicate < Field > inClass ( Class < ? > clazz ) { return field -> field . getDeclaringClass ( ) . equals ( clazz ) ; }
Create a predicate to check that a field is defined in a given class .