### Question:
Types { public static String generatedJsonAdapterName(Class<?> clazz) { if (clazz.getAnnotation(JsonClass.class) == null) { throw new IllegalArgumentException("Class does not have a JsonClass annotation: " + clazz); } return generatedJsonAdapterName(clazz.getName()); } 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 generatedJsonAdapterName_strings() { assertThat(Types.generatedJsonAdapterName("com.foo.Test")).isEqualTo("com.foo.TestJsonAdapter"); assertThat(Types.generatedJsonAdapterName("com.foo.Test$Bar")) .isEqualTo("com.foo.Test_BarJsonAdapter"); }
@Test public void generatedJsonAdapterName_class() { assertThat(Types.generatedJsonAdapterName(TestJsonClass.class)) .isEqualTo("com.squareup.moshi.TypesTest_TestJsonClassJsonAdapter"); }
@Test public void generatedJsonAdapterName_class_missingJsonClass() { try { Types.generatedJsonAdapterName(TestNonJsonClass.class); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessageThat().contains("Class does not have a JsonClass annotation"); } }