### Question:
TypeUtils { public static Set<Class<?>> typeClosure(Class<?> type) { if (type == null) { return Collections.emptySet(); } Set<Class<?>> supertypes = new HashSet<>(); supertypes.add(type); supertypes.addAll(typeClosure(type.getSuperclass())); for (Class<?> iface : type.getInterfaces()) { supertypes.addAll(typeClosure(iface)); } return supertypes; } 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 testTypeClosure() { Set<Class<?>> closure = TypeUtils.typeClosure(SortedSet.class); assertTrue(closure.contains(SortedSet.class)); assertTrue(closure.contains(Set.class)); assertTrue(closure.contains(Collection.class)); assertTrue(closure.contains(Iterable.class)); assertFalse(closure.contains(List.class)); assertFalse(closure.contains(null)); }