public static Collection<Field> getAttributes(
            final Class<?> classToInspect, final Predicate<Field> filter) {
        Set<Field> allFields = new HashSet<>();
        getAllAttributes(classToInspect, allFields, Function.identity(), filter);
        return allFields;
    }
public static Collection < Field > getAttributes ( final Class < ? > classToInspect , final Predicate < Field > filter ) { Set < Field > allFields = new HashSet < > ( ) ; getAllAttributes ( classToInspect , allFields , Function . identity ( ) , filter ) ; return allFields ; }
Get a subset of the attributes of the provided class.  An attribute is each public field in the class
or super class.

@param classToInspect the class to inspect
@param filter a predicate that returns true when a attribute should be kept in resulting
collection.