FreqMapConverter implements Converter { @Override public scala.collection.mutable.Map<String, Long> convert(final Object object) throws ConversionException { return JavaConverters.mapAsScalaMapConverter((FreqMap) object).asScala(); }  @Override boolean canHandle(final Class clazz); @Override DataType convertedType(); @Override scala.collection.mutable.Map<String, Long> convert(final Object object);  }
@Test public void testConverter() throws ConversionException { final FreqMap freqMap = new FreqMap(); freqMap.put("x", 10L); freqMap.put("y", 5L); freqMap.put("z", 20L); final scala.collection.mutable.Map<String, Long> expectedResult = scala.collection.mutable.Map$.MODULE$.empty(); expectedResult.put("x", 10L); expectedResult.put("y", 5L); expectedResult.put("z", 20L); assertEquals(expectedResult, FREQ_MAP_CONVERTER.convert(freqMap)); final FreqMap emptyFreqMap = new FreqMap(); expectedResult.clear(); assertEquals(expectedResult, FREQ_MAP_CONVERTER.convert(emptyFreqMap)); }