SeparatorAnalyzer implements Consumer<Separator> { @Override public void accept(Separator separator) { separator.setScore(computeEntropy(separator)); CSVFastHeaderAndTypeAnalyzer csvFastHeaderAndTypeAnalyzer = new CSVFastHeaderAndTypeAnalyzer(sampleLines, separator); csvFastHeaderAndTypeAnalyzer.analyze(); separator.setFirstLineAHeader(csvFastHeaderAndTypeAnalyzer.isFirstLineAHeader()); separator.setHeaderInfoReliable(csvFastHeaderAndTypeAnalyzer.isHeaderInfoReliable()); separator.setHeaders(csvFastHeaderAndTypeAnalyzer.getHeaders()); } SeparatorAnalyzer(int numberOfLines, List<String> sampleLines); @Override void accept(Separator separator); int compare(Separator s1, Separator s2);  }
@Test public void should_set_default_score() { SeparatorAnalyzer analyzer = new SeparatorAnalyzer(100, Arrays.asList("first", "last")); Separator sep = new Separator('|'); analyzer.accept(sep); assertEquals(Double.MAX_VALUE, sep.getScore(), 0.000000001); }