ArgFilters { public static Predicate<Field> selectClass(final Class<?> clazz) { Preconditions.checkNotNull(clazz); return field -> field.getDeclaringClass().equals(clazz); } private  ArgFilters(); static Predicate<Field> selectPackage(final Package pkg); static Predicate<Field> selectAllPackagesUnderHere(final Package pkg); static Predicate<Field> selectClass(final Class<?> clazz); static Predicate<Field> selectClasses(final Class<?> ... cls); static Predicate<Field> selectCmdLineArg(Class<?> clazz, final String name); static final Predicate<Field> SELECT_ALL; }
@Test public void testClass() throws IOException { testFilter(ArgFilters.selectClass(ArgFiltersTest.class), fieldInfo(ArgFiltersTest.class, "A"), fieldInfo(ArgFiltersTest.class, "B")); }