@Test public void testGet_ReturnsSameAccessorOnSubsequentCalls() { PropertyAccessor<TestObject, ?> propertyAccessor = PropertyAccessorCache.get(TestObject.class, TestObject.STRING_PROPERTY); assertThat(propertyAccessor.getPropertyName(), is(TestObject.STRING_PROPERTY)); assertThat(PropertyAccessorCache.get(TestObject.class, TestObject.STRING_PROPERTY), is(sameInstance(propertyAccessor))); }
@SuppressWarnings("unchecked") public static <T> PropertyAccessor<T, ?> get(Class<T> clazz, String property) { return (PropertyAccessor<T, ?>)ACCESSOR_CACHE.get(new CacheKey(clazz, property)); }
PropertyAccessorCache { @SuppressWarnings("unchecked") public static <T> PropertyAccessor<T, ?> get(Class<T> clazz, String property) { return (PropertyAccessor<T, ?>)ACCESSOR_CACHE.get(new CacheKey(clazz, property)); } }
PropertyAccessorCache { @SuppressWarnings("unchecked") public static <T> PropertyAccessor<T, ?> get(Class<T> clazz, String property) { return (PropertyAccessor<T, ?>)ACCESSOR_CACHE.get(new CacheKey(clazz, property)); } private  PropertyAccessorCache(); }
PropertyAccessorCache { @SuppressWarnings("unchecked") public static <T> PropertyAccessor<T, ?> get(Class<T> clazz, String property) { return (PropertyAccessor<T, ?>)ACCESSOR_CACHE.get(new CacheKey(clazz, property)); } private  PropertyAccessorCache(); @SuppressWarnings("unchecked") static PropertyAccessor<T, ?> get(Class<T> clazz, String property); }
PropertyAccessorCache { @SuppressWarnings("unchecked") public static <T> PropertyAccessor<T, ?> get(Class<T> clazz, String property) { return (PropertyAccessor<T, ?>)ACCESSOR_CACHE.get(new CacheKey(clazz, property)); } private  PropertyAccessorCache(); @SuppressWarnings("unchecked") static PropertyAccessor<T, ?> get(Class<T> clazz, String property);  }