FrequencyService extends AbstractService { @Override public void init() { frequencyMaps.clear(); maxOccurence.clear(); secondMaxOccurence.clear(); } FrequencyService(DataSet dataset); HashMap<Object, Integer> putAttributeValues(String column, boolean ignoreBlanks); HashSet<Object> getMostCommonValue(String column, boolean ignoreBlanks); HashSet<Object> getSecondMostCommonValue(String column, boolean ignoreBlanks); @Override void init();  }
@Test public void testInit() { List<Column> columnList = generateColumnList(); DataSet dataSet = new DataSet(columnList); dataSet.initData(generateInputData()); FrequencyService fs = new FrequencyService(dataSet); fs.putAttributeValues("firstName", false); fs.putAttributeValues("lastName", false); Assert.assertEquals("frequencyMaps size should be 2", 2, fs.frequencyMaps.size()); Assert.assertEquals("maxOccurence size should be 2", 2, fs.maxOccurence.size()); Assert.assertEquals("secondMaxOccurence size should be 2", 2, fs.secondMaxOccurence.size()); fs.init(); Assert.assertEquals("frequencyMaps size should be 0", 0, fs.frequencyMaps.size()); Assert.assertEquals("maxOccurence size should be 0", 0, fs.maxOccurence.size()); Assert.assertEquals("secondMaxOccurence size should be 0", 0, fs.secondMaxOccurence.size()); }