@Override
    public Entry next(Entry reuse) throws IOException {
        // Ignore reuse, because each HeadStream has its own reuse BinaryRowData.
        return next();
    }
@Test
    public void testMergeOfTenStreams() throws Exception {
        List<MutableObjectIterator<BinaryRowData>> iterators = new ArrayList<>();
        iterators.add(
                newIterator(new int[] {1, 2, 17, 23, 23}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {2, 6, 7, 8, 9}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {4, 10, 11, 11, 12}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {3, 6, 7, 10, 12}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {7, 10, 15, 19, 44}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {6, 6, 11, 17, 18}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {1, 2, 4, 5, 10}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {5, 10, 19, 23, 29}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {9, 9, 9, 9, 9}, new String[] {"A", "B", "C", "D", "E"}));
        iterators.add(
                newIterator(new int[] {8, 8, 14, 14, 15}, new String[] {"A", "B", "C", "D", "E"}));

        TypeComparator<Integer> comparator = new IntComparator(true);

        MutableObjectIterator<BinaryRowData> iterator =
                new BinaryMergeIterator<>(
                        iterators, reused(10), (o1, o2) -> this.comparator.compare(o1, o2));

        BinaryRowData row = serializer.createInstance();

        int pre = 0;
        while ((row = iterator.next(row)) != null) {
            assertThat(comparator.compare(row.getInt(0), pre)).isGreaterThanOrEqualTo(0);
            pre = row.getInt(0);
        }
    }