### Question:
Types { public static @Nullable Set<? extends Annotation> nextAnnotations( Set<? extends Annotation> annotations, Class<? extends Annotation> jsonQualifier) { if (!jsonQualifier.isAnnotationPresent(JsonQualifier.class)) { throw new IllegalArgumentException(jsonQualifier + " is not a JsonQualifier."); } if (annotations.isEmpty()) { return null; } for (Annotation annotation : annotations) { if (jsonQualifier.equals(annotation.annotationType())) { Set<? extends Annotation> delegateAnnotations = new LinkedHashSet<>(annotations); delegateAnnotations.remove(annotation); return Collections.unmodifiableSet(delegateAnnotations); } } return null; } 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:
@Test public void nextAnnotationsRequiresJsonAnnotation() throws Exception { try { Types.nextAnnotations(Collections.<Annotation>emptySet(), TestAnnotation.class); fail(); } catch (IllegalArgumentException expected) { assertThat(expected) .hasMessageThat() .isEqualTo( "interface com.squareup.moshi.TypesTest$TestAnnotation is not a JsonQualifier."); } }