ArgFilters { public static Predicate<Field> selectPackage(final Package pkg) { Preconditions.checkNotNull(pkg); return field -> field.getDeclaringClass().getPackage().equals(pkg); } 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 testpackage() throws IOException { testFilter(ArgFilters.selectPackage(ArgsRoot.class.getPackage()), fieldInfo(ArgsRoot.class, "ARGS_ROOT")); }