@SuppressWarnings("ArraysAsListWithZeroOrOneArgument") @Test public void createFromValuePairsTest(){ List<List<CsvDataCell>> rows = new LinkedList<>(); rows.add(Arrays.asList(new CsvDataCell("1", "a"))); rows.add(Arrays.asList(new CsvDataCell("2", "b"))); rows.add(Arrays.asList(new CsvDataCell("2", "bb"),new CsvDataCell("3", "c"))); rows.add(Arrays.asList(new CsvDataCell("3", "cc"))); CsvContent expected = new CsvContent(Arrays.asList("1", "2", "3")); expected.addRow(Arrays.asList("a", "", "")); expected.addRow(Arrays.asList("", "b", "")); expected.addRow(Arrays.asList("", "bb", "c")); expected.addRow(Arrays.asList("", "", "cc")); assertEquals(expected, CsvContent.createFromValuePairs(null, rows)); List<String> header = Arrays.asList("11", "22", "2"); CsvContent expected2 = new CsvContent(Arrays.asList("11", "22", "2", "1", "3")); expected2.addRow(Arrays.asList("", "", "", "a", "")); expected2.addRow(Arrays.asList("", "", "b", "", "")); expected2.addRow(Arrays.asList("", "", "bb", "", "c")); expected2.addRow(Arrays.asList("", "", "", "", "cc")); assertEquals(expected2, CsvContent.createFromValuePairs(header, rows)); }
public static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows) { return createFromValuePairs(null, rows); }
CsvContent { public static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows) { return createFromValuePairs(null, rows); } }
CsvContent { public static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows) { return createFromValuePairs(null, rows); } CsvContent(List<String> header);  CsvContent(String... header); }
CsvContent { public static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows) { return createFromValuePairs(null, rows); } CsvContent(List<String> header);  CsvContent(String... header); void addRow(List<String> row); void addRow(String... row); void convertObjectsToStringsAndAddRow(Object... row); ArrayList<String> getHeader(); List<ArrayList<String>> getRows(); void writeEntireCsv(Writer writer); void writeEntireCsv(Path csvOutputFile); static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows); static CsvContent createFromValuePairs(@Nullable List<String> header, List<List<CsvDataCell>> rows); CsvContent getSortedShallowCopy(
            int columnIndex, Function<String, T> comparator); @Override boolean equals(Object o); @Override int hashCode(); }
CsvContent { public static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows) { return createFromValuePairs(null, rows); } CsvContent(List<String> header);  CsvContent(String... header); void addRow(List<String> row); void addRow(String... row); void convertObjectsToStringsAndAddRow(Object... row); ArrayList<String> getHeader(); List<ArrayList<String>> getRows(); void writeEntireCsv(Writer writer); void writeEntireCsv(Path csvOutputFile); static CsvContent createFromValuePairs(List<List<CsvDataCell>> rows); static CsvContent createFromValuePairs(@Nullable List<String> header, List<List<CsvDataCell>> rows); CsvContent getSortedShallowCopy(
            int columnIndex, Function<String, T> comparator); @Override boolean equals(Object o); @Override int hashCode();  }