### Question:
JdbcBatchLoader extends BaseJdbcLoader { @Override public void sort(ETLBucket bucket) { bucket.getParallelRows().addAll(batchGroup(bucket.getRows())); }  @Override Pair<Boolean, List<DSubmitStatObject>> doLoad(ETLBucket bucket); @Override void sort(ETLBucket bucket);  }### Answer:
@Test public void sort() { List<ETLRow> rows = new ArrayList<>(); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.DELETE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.DELETE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.DELETE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.TRUNCATE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.TRUNCATE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.UPDATE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.TRUNCATE, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); rows.add(new ETLRow(0, 0, "s", "t", MessageAction.INSERT, null, null, null)); ETLBucket bucket = new ETLBucket("0", rows, null); new JdbcBatchLoader().sort(bucket); Assert.assertEquals(bucket.getParallelRows().stream().mapToLong(r -> r.size()).sum(), rows.size()); }