ReflectionUtils { @Api(2.0) @NonNull public static Field[] getFields(@NonNull Class clazz, boolean bringParents) { return bringParents ? clazz.getFields() : clazz.getDeclaredFields(); } private  ReflectionUtils(); @Api(2.0) @Nullable static Class<?> toClass(@Nullable String name); @Api(2.0) @Nullable static T newInstance(@NonNull Class<T> clazz); @Api(2.0) @NonNull static Constructor<T> getConstructor(@NonNull Class<T> constructedClass, @NonNull Class<D> innerConstructorClass); @Api(2.0) @NonNull static T build(@NonNull Constructor<T> constructor, @Nullable Object... data); @Api(2.0) @NonNull static String classNameToInnerFilter(@NonNull String className); @Api(2.0) @NonNull static Field[] getFields(@NonNull Class clazz, boolean bringParents); @Api(2.0) @NonNull static T valueOf(Field field, Object reference, Class<T> clazz);  }
@Test public void thatCanGetReflectionField(){ Field [] fields = ReflectionUtils.getFields(PrivateConstructorWithField.class,false); assertThat(fields).isNotNull(); }