Keys { public static String getClassName(String key) { int start = 0; if (key.startsWith("@") || key.startsWith("members/")) { start = key.lastIndexOf('/') + 1; } return (key.indexOf('<', start) == -1 && key.indexOf('[', start) == -1) ? key.substring(start) : null; } Keys(); static String get(Type type); static String getMembersKey(Class<?> key); static String getSetKey(Type type, Annotation[] annotations, Object subject); static String get(Type type, Annotation[] annotations, Object subject); static boolean isAnnotated(String key); static String getClassName(String key); static boolean isPlatformType(String name);  }
@Test public void testGetClassName() throws NoSuchFieldException { assertThat(Keys.getClassName(fieldKey("className"))) .isEqualTo("java.lang.String"); }
@Test public void testGetClassNameWithoutAnnotation() throws NoSuchFieldException { assertThat(Keys.getClassName(fieldKey("classNameWithAnnotation"))) .isEqualTo("java.lang.String"); }
@Test public void testGetClassNameArray() throws NoSuchFieldException { assertThat(Keys.getClassName(fieldKey("classNameArray"))).isNull(); }
@Test public void testGetClassParameterized() throws NoSuchFieldException { assertThat(Keys.getClassName(fieldKey("classNameParameterized"))).isNull(); }