ToFreqMap extends KorypheFunction<Object, FreqMap> { @Override public FreqMap apply(final Object value) { return new FreqMap(null != value ? value.toString() : null); }  @Override FreqMap apply(final Object value);  }
@Test public void shouldConvertStringToFreqMap() { final ToFreqMap function = new ToFreqMap(); final String value = "value1"; final FreqMap result = function.apply(value); assertEquals(new FreqMap(value), result); }
@Test public void shouldConvertObjectToFreqMap() { final ToFreqMap function = new ToFreqMap(); final Object value = 1L; final FreqMap result = function.apply(value); assertEquals(new FreqMap(value.toString()), result); }
@Test public void shouldConvertNullToFreqMap() { final ToFreqMap function = new ToFreqMap(); final FreqMap result = function.apply(null); assertEquals(new FreqMap((String) null), result); }