StringService extends AbstractService { public boolean isLongestValue(Object var, String column, boolean ignoreBlanks) { if (longestValueMap.get(column) == null) { putAttributeValues(column, ignoreBlanks); } return longestValueMap.get(column).contains(var); } StringService(DataSet dataset); void putAttributeValues(String column, boolean ignoreBlanks); boolean isLongestValue(Object var, String column, boolean ignoreBlanks); boolean isSecondLongestValue(Object var, String column, boolean ignoreBlanks); boolean isShortestValue(Object var, String column, boolean ignoreBlanks); boolean isSecondShortestValue(Object var, String column, boolean ignoreBlanks); @Override void init();  }
@Test public void testIsLongestValue() { List<Column> columnList = generateColumnList(); DataSet dataSet = new DataSet(columnList); dataSet.initData(generateInputData()); StringService ss = new StringService(dataSet); ss.putAttributeValues("firstName", false); ss.putAttributeValues("lastName", false); Assert.assertEquals("Brianna should be longest value on the column firstName", true, ss.isLongestValue("Brianna", "firstName", false)); Assert.assertEquals("cook should be longest value on the column lastName", true, ss.isLongestValue("cook", "lastName", false)); Assert.assertEquals("1111 should not be longest value on the column lastName", false, ss.isLongestValue("1111", "lastName", false)); ss.init(); }