public static < T extends Executable > Predicate < T > executableBelongsToClass ( Class < ? > reference ) { return candidate -> candidate != null && reference . equals ( candidate . getDeclaringClass ( ) ) ; }
Checks if a candidate executable does belong to the specified class .