/** * Appends {@code numEntries} increasingly numbered ByteBuffer wrapped entries to the log, * starting at the {@code startingId}. */ protected List<Long> appendEntries(int numEntries, int startingId, Compaction.Mode mode) { List<Integer> entryIds = IntStream.range(startingId, startingId + numEntries).boxed().collect(Collectors.toList()); return entryIds .stream() .map( entryId -> { try (TestEntry entry = log.create(TestEntry.class)) { entry.setTerm(1).setCompactionMode(mode).setPadding(entryPadding); return log.append(entry); } }) .collect(Collectors.toList()); }