### Question:
SpoonCodeInstrument extends JfxInstrument implements Initializable { String prettyPrintType(final Type type) { if(type instanceof Class) { return ((Class<?>) type).getSimpleName(); } if(type instanceof ParameterizedType) { final ParameterizedType paramType = (ParameterizedType) type; return getUnqualifiedClassName(paramType.getRawType().getTypeName()) + Arrays .stream(paramType.getActualTypeArguments()) .map(arg -> prettyPrintType(arg)) .collect(Collectors.joining(", ", "<", ">")); } return type.getTypeName(); }  @Override void initialize(final URL url, final ResourceBundle res);  }### Answer:
@Test void prettyPrintTypdeTwoNestedGenerics() throws NoSuchMethodException { final String string = spoonCodeInstrument.prettyPrintType(Stub.class.getMethod("bar").getGenericReturnType()); assertThat(string).isEqualTo("Stub2<CtClass<String>>"); }
@Test void prettyPrintTypdeTwoGenerics() throws NoSuchMethodException { final String string = spoonCodeInstrument.prettyPrintType(Stub.class.getMethod("meth").getGenericReturnType()); assertThat(string).isEqualTo("Stub3<CtStatement, ?>"); }
@Test void prettyPrintTypeClass() { final String string = spoonCodeInstrument.prettyPrintType(CtClass.class); assertThat(string).isEqualTo("CtClass"); }
@Test void prettyPrintTypeGeneric() throws NoSuchMethodException { final String string = spoonCodeInstrument.prettyPrintType(Stub.class.getMethod("foo").getGenericReturnType()); assertThat(string).isEqualTo("Stub2<CtClass<?>>"); }