### Question:
Types { @SuppressWarnings("unchecked") static <T extends Annotation> T createJsonQualifierImplementation(final Class<T> annotationType) { if (!annotationType.isAnnotation()) { throw new IllegalArgumentException(annotationType + " must be an annotation."); } if (!annotationType.isAnnotationPresent(JsonQualifier.class)) { throw new IllegalArgumentException(annotationType + " must have @JsonQualifier."); } if (annotationType.getDeclaredMethods().length != 0) { throw new IllegalArgumentException(annotationType + " must not declare methods."); } return (T) Proxy.newProxyInstance( annotationType.getClassLoader(), new Class<?>[] {annotationType}, new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); switch (methodName) { case "annotationType": return annotationType; case "equals": Object o = args[0]; return annotationType.isInstance(o); case "hashCode": return 0; case "toString": return "@" + annotationType.getName() + "()"; default: return method.invoke(proxy, args); } } }); } private  Types(); static String generatedJsonAdapterName(Class<?> clazz); static String generatedJsonAdapterName(String className); static @Nullable Set<? extends Annotation> nextAnnotations(
      Set<? extends Annotation> annotations, Class<? extends Annotation> jsonQualifier); static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments); static ParameterizedType newParameterizedTypeWithOwner(
      Type ownerType, Type rawType, Type... typeArguments); static GenericArrayType arrayOf(Type componentType); static WildcardType subtypeOf(Type bound); static WildcardType supertypeOf(Type bound); static Class<?> getRawType(Type type); static Type collectionElementType(Type context, Class<?> contextRawType); static boolean equals(@Nullable Type a, @Nullable Type b); static Set<? extends Annotation> getFieldJsonQualifierAnnotations(
      Class<?> clazz, String fieldName);  }### Answer:
@SuppressWarnings("GetClassOnAnnotation") @Test public void createJsonQualifierImplementation() throws Exception { TestQualifier actual = Types.createJsonQualifierImplementation(TestQualifier.class); TestQualifier expected = (TestQualifier) TypesTest.class.getDeclaredField("hasTestQualifier").getAnnotations()[0]; assertThat(actual.annotationType()).isEqualTo(TestQualifier.class); assertThat(actual).isEqualTo(expected); assertThat(actual).isNotEqualTo(null); assertThat(actual.hashCode()).isEqualTo(expected.hashCode()); assertThat(actual.getClass()).isNotEqualTo(TestQualifier.class); }