ToTypeSubTypeValue extends KorypheFunction<Object, TypeSubTypeValue> { @Override public TypeSubTypeValue apply(final Object value) { return new TypeSubTypeValue(null, null, null != value ? value.toString() : null); }  @Override TypeSubTypeValue apply(final Object value);  }
@Test public void shouldConvertStringToTypeSubTypeValue() { final ToTypeSubTypeValue function = new ToTypeSubTypeValue(); final String value = "value1"; final TypeSubTypeValue result = function.apply(value); assertEquals(new TypeSubTypeValue(null, null, value), result); }
@Test public void shouldConvertObjectToTypeSubTypeValue() { final ToTypeSubTypeValue function = new ToTypeSubTypeValue(); final Object value = 1L; final TypeSubTypeValue result = function.apply(value); assertEquals(new TypeSubTypeValue(null, null, value.toString()), result); }
@Test public void shouldConvertNullToTypeSubTypeValue() { final ToTypeSubTypeValue function = new ToTypeSubTypeValue(); final TypeSubTypeValue result = function.apply(null); assertEquals(new TypeSubTypeValue(null, null, null), result); }