### Question:
BeanUtils { public static Collection<Field> getFieldsIgnore(Class clazz, Collection<String> ignores) { Set<Field> ret = new HashSet<>(); for (Class superClass = clazz; superClass != Object.class; superClass = superClass.getSuperclass()) { for (Field declaredField : superClass.getDeclaredFields()) { if (!ignores.contains(declaredField.getName())) { ret.add(declaredField); } } } return ret; } private  BeanUtils(); static List<Field> getDeclaredFields(Object object, Class fieldClass); static List<Field> getDeclaredFields(Class clazz, Class fieldClass); static Field getDeclaredField(Object object, String propertyName); static Field getDeclaredField(Class clazz, String propertyName); static Collection<Field> getAllFields(Class clazz); static Collection<Field> getFieldsIgnore(Class clazz, Collection<String> ignores); static Collection<Field> getFieldsIgnore(Class clazz, Class... annoClasses); static List<T> forceGetProperties(Object object, Class<T> fieldClass); static Object forceGetProperty(Object object, String propertyName); static Object forceGetProperty(Object object, Field field); static void forceSetProperty(Object object, String propertyName, Object newValue); static void forceSetProperty(Object object, Field field, Object newValue); static void forceSetPropertyFromString(Object entity, String fieldName, String value); static void forceSetPropertyFromString(Object entity, Field field, String value); static Object forceInvokeMethod(Object object, String methodName, Object... params); static List<Field> getDeclaredFieldsByType(Object object, Class propertyType); static List<Field> getDeclaredFieldsByTypeIgnore(Object object, Class propertyType, Class... annoClasses); static List<Field> getStaticFields(Class clazz); static List<Field> getStaticFieldsByType(Class clazz, Class propertyType); static Class getPropertyType(Class clazz, String propertyName); static List<T> getPropertiesByType(Object bean, Class<T> fieldClass); static String getGetterName(Class clazz, String fieldName);  }### Answer:
@Test public void testGetFieldsIgnore() { Collection<Field> fieldsIgnore = BeanUtils.getFieldsIgnore(FooBarBean.class, JsonIgnore.class); List<Field> l = new ArrayList<>(fieldsIgnore); Assertions.assertEquals(1, fieldsIgnore.size()); Assertions.assertEquals("field1", l.get(0).getName()); }