@Test public void testCreate() { Map<String, ReflectionUtil.PropertyAccessor<?>> propertyAccessors = ReflectionUtil.getPropertyAccessors(TestBean.class); String[] expectedKeys = { "init", "port", "nastav", "valueField", "value", "set" }; assertAll( () -> assertThat(propertyAccessors.keySet(), hasSize(expectedKeys.length)), () -> assertThat(propertyAccessors.keySet(), containsInAnyOrder(expectedKeys)) ); }
static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } private  ReflectionUtil(); }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } private  ReflectionUtil();  }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } private  ReflectionUtil();   }