### Question:
TypeUtils { @SuppressWarnings("unchecked") public static <T> String makeTypeName(TypeToken<T> type) { Class<?> raw = type.getRawType(); if (raw.equals(List.class)) { return makeTypeName(listElementType((TypeToken) type)) + "[]"; } else if (raw.equals(String.class)) { return "string"; } else if (raw.equals(Double.class)) { return "double"; } else if (raw.equals(Integer.class)) { return "int"; } else if (raw.equals(Long.class)) { return "long"; } else { return raw.getName(); } } private  TypeUtils(); static Set<Class<?>> typeClosure(Class<?> type); static TypeToken<List<T>> makeListType(TypeToken<T> element); @SuppressWarnings("unchecked") static TypeToken<T> listElementType(TypeToken<? extends List<T>> token); static TypeToken<?> resolveTypeName(String type); @SuppressWarnings("unchecked") static String makeTypeName(TypeToken<T> type); @SuppressWarnings("unchecked") static FromStringConverter<T> lookupFromStringConverter(TypeToken<T> type);  }### Answer:
@Test public void testStringifyBasicTypes() { assertThat(makeTypeName(TypeToken.of(String.class)), equalTo("string")); assertThat(makeTypeName(TypeToken.of(Long.class)), equalTo("long")); assertThat(makeTypeName(TypeToken.of(File.class)), equalTo("java.io.File")); assertThat(makeTypeName(TypeToken.of(Integer.class)), equalTo("int")); assertThat(makeTypeName(TypeToken.of(Double.class)), equalTo("double")); }
@Test public void testStringifyListType() { TypeToken<List<String>> strList = new TypeToken<List<String>>() {}; assertThat(makeTypeName(strList), equalTo("string[]")); assertThat(makeTypeName(new TypeToken<List<List<Double>>>() {}), equalTo("double[][]")); }