class TableDiff {

  @VisibleForTesting
  static Map<List<Object>, List<Row>> buildMap(Rows rows, List<ColumnMetadata> metadata) {
    Map<List<Object>, List<Row>> map = new HashMap<>();
    Iterator<Row> iterator = rows.iterator();
    while (iterator.hasNext()) {
      Row row = iterator.next();
      map.computeIfAbsent(row.getKey(metadata), k -> new LinkedList<>()).add(row);
    }
    return map;
  }

  private  TableDiff();

}