ArgFilters { public static Predicate<Field> selectCmdLineArg(Class<?> clazz, final String name) { MorePreconditions.checkNotBlank(name); return Predicates.and(selectClass(clazz), field -> { return field.getAnnotation(CmdLine.class).name().equals(name); }); } 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 testArg() throws IOException { testFilter(ArgFilters.selectCmdLineArg(ArgFiltersTest.class, "b"), fieldInfo(ArgFiltersTest.class, "B")); }