TabularResultModel extends AbstractResultModel { @JsonIgnore public List<String> getValuesInRow(int index) { List<String> headers = getHeaders(); List<String> values = new ArrayList<>(); for (String header : headers) { values.add(table.get(header).get(index)); } return values; } TabularResultModel(); TabularResultModel accumulate(String column, String value); void addMemberStatusResultRow(String member, String result, String message); @Override Map<String, List<String>> getContent(); void setColumnHeader(String... columnHeaders); void addRow(String... values); @JsonIgnore List<String> getHeaders(); @JsonIgnore String getValue(String columnName, int rowIndex); @JsonIgnore int getColumnSize(); @JsonIgnore int getRowSize(); @JsonIgnore List<String> getValuesInColumn(String header); @JsonIgnore List<String> getValuesInRow(int index);  }
@Test public void getValuesInRow() { table1.setColumnHeader("c1", "c2", "c3"); table1.addRow("v1", "k1", "t1"); table1.addRow("v2", "k2", "t2"); table1.addRow("v3", "k3", "t3"); assertThat(table1.getValuesInRow(0)).containsExactly("v1", "k1", "t1"); assertThat(table1.getValuesInRow(1)).containsExactly("v2", "k2", "t2"); assertThat(table1.getValuesInRow(2)).containsExactly("v3", "k3", "t3"); new TabularResultModelAssert(table1).hasAnyRow().contains("v1", "k1", "t1") .hasAnyRow().contains("v3", "k3", "t3"); }