StringTypeConverter implements TypeConverter { public Object toNative(Object value, ToNativeContext context) { if (value == null) { return null; } String valueAsString = (String) value; ID valueAsID = Foundation.cfString(valueAsString); Foundation.sendReturnsID(valueAsID, "autorelease"); return valueAsID.toNative(); }  Class<?> nativeType(); String fromNative(Object nativeValue, FromNativeContext context); Object toNative(Object value, ToNativeContext context);  }
@Test public void convertsNullAsArgumentToNull() { assertEquals(null, converter.toNative(null, null)); }