### Question:
TypeConverter { public Serializable convert(String className, String convert) throws ConversionException { return factory.createConverter(className).convert(convert); } TypeConverter();  TypeConverter(ConverterFactory factory); Serializable convert(String className, String convert);  }### Answer:
@Test @SuppressWarnings({ "rawtypes", "unchecked" }) public void convertCreateAFactoryAndConvertStringValueToSerializableObject() throws Exception { Converter typedConverter = mock(Converter.class); when(factory.createConverter(anyString())).thenReturn(typedConverter); converter.convert("aClassName", "somethingToconvert"); verify(typedConverter).convert("somethingToconvert"); }