RococoaTypeMapper extends DefaultTypeMapper { @SuppressWarnings("unchecked") @Override public FromNativeConverter getFromNativeConverter(Class javaType) { if (ObjCObject.class.isAssignableFrom(javaType)) { return new ObjCObjectTypeConverter((Class<ObjCObject>)javaType); } return super.getFromNativeConverter(javaType); } RococoaTypeMapper(); @SuppressWarnings("unchecked") @Override FromNativeConverter getFromNativeConverter(Class javaType);  }
@Test public void testString() { assertTrue(typeMapper.getToNativeConverter(String.class) instanceof StringTypeConverter); assertTrue(typeMapper.getFromNativeConverter(String.class) instanceof StringTypeConverter); }
@Test public void testObjCObject() { ObjCObjectTypeConverter toNativeConverter = (ObjCObjectTypeConverter) typeMapper.getToNativeConverter(NSNumber.class); assertTrue(toNativeConverter.convertsJavaType(ObjCObject.class)); ObjCObjectTypeConverter fromNativeConverter = (ObjCObjectTypeConverter) typeMapper.getFromNativeConverter(NSNumber.class); assertTrue(fromNativeConverter.convertsJavaType(NSNumber.class)); }