### Question:
GenericsTypeConverter implements Converter { @Override public boolean canConvert( Object fromValue, ReifiedType toType ) { return converterClasses .keySet() .stream() .anyMatch( fromClass -> fromClass.isAssignableFrom( fromValue.getClass() ) && toType.getRawClass() == converterClasses.get( fromClass ) ); } GenericsTypeConverter( Map<Class, Class> converterClasses ); @Override boolean canConvert( Object fromValue, ReifiedType toType ); @Override Object convert( Object source, ReifiedType toType );  }### Answer:
@Test public void testCanConvertReturnsFalseClassIsNotFromReifiedType() { Map<Class, Class> converterClasses = new HashMap<>(); GenericsTypeConverter converter = new GenericsTypeConverter( converterClasses ); assertFalse( converter.canConvert( new A(), new ReifiedType( A.class ) ) ); assertFalse( converter.canConvert( new B(), new ReifiedType( A.class ) ) ); }
@Test public void testCanConvertReturnsTrueClassIsReifiedType() { Map<Class, Class> converterClasses = new HashMap<>(); converterClasses.put( C.class, A.class ); GenericsTypeConverter converter = new GenericsTypeConverter( converterClasses ); assertTrue( converter.canConvert( new C(), new ReifiedType( A.class ) ) ); }