ArgFilters { public static Predicate<Field> selectClasses(final Class<?> ... cls) { Preconditions.checkNotNull(cls); final Set<Class<?>> listOfClasses = ImmutableSet.copyOf(cls); return field -> listOfClasses.contains(field.getDeclaringClass()); } 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 testClasses() throws IOException { testFilter(ArgFilters.selectClasses(ArgFiltersTest.class, ArgsA.class), fieldInfo(ArgFiltersTest.class, "A"), fieldInfo(ArgFiltersTest.class, "B"), fieldInfo(ArgsA.class, "ARGS_A")); }