### Question:
TypeTypeConverter implements TypeConverter { @Override public String toString(Type ignored, Object value) { if (value == null) { return Expression.Undefined.class.getName(); } String result = typeToStringCache.get(value); if (result == null) { result = convertType(value); String prev = typeToStringCache.putIfAbsent((Type) value, result); result = prev != null ? prev : result; } return result; }  @Override boolean isApplicable(Type type); @Override Object fromString(Type ignored, String value); @Override String toString(Type ignored, Object value);  }### Answer:
@Test void shouldThrowExceptionWhenUnsupportedTypeToConvert() { Type unknownType = new Type() { @Override public String getTypeName() { return "UnknownType"; } }; assertThatThrownBy(() -> typeConverter.toString(null, unknownType)) .isExactlyInstanceOf(IllegalArgumentException.class); }
@Test void shouldProperlyConvertFromNullLiteralString() { String converted = typeConverter.toString(null, null); assertThat(converted).isEqualTo(Expression.Undefined.class.getName()); }
@Test void shouldProperlyConvertNestedGenericToString() { String converted = typeConverter.toString(null, TypeUtils.parameterize(Map.class, String.class, TypeUtils.parameterize(List.class, Object.class))); assertThat(converted).isEqualTo("Map<String,List<Object>>"); }