Keys { public static boolean isAnnotated(String key) { return key.startsWith("@"); } 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 testAnnotated() throws NoSuchFieldException { assertThat(fieldKey("annotated")).isEqualTo("@javax.inject.Named(value=foo)/java.lang.String"); assertThat(Keys.isAnnotated(fieldKey("annotated"))).isTrue(); }
@Test public void testIsAnnotatedFalse() throws NoSuchFieldException { assertThat(Keys.isAnnotated(fieldKey("notAnnotated"))).isFalse(); }