public void removeCommittedEntries(Map<TopicPartition, OffsetAndMetadata> committed, Exception exception) {
        if (exception == null) {
            committed.forEach(this::removeCommittedEntry);
        } else {
            LOG.error("Failed to commit offset: {}", exception.getMessage(), exception);
        }
    }
@Order(4)
    @Test
    @DisplayName("Tests whether the cache removes committed offsets")
    void removeCommittedEntries() {
        final TopicPartition topic11 = new TopicPartition("topic1", 1);
        final TopicPartition topic12 = new TopicPartition("topic1", 2);
        final TopicPartition topic13 = new TopicPartition("topic1", 3);

        final Map<TopicPartition, OffsetAndMetadata> offsets = Collections.singletonMap(topic12, new OffsetAndMetadata(3));

        offsetCache.removeCommittedEntries(offsets, null);

        assertEquals(2, offsetCache.getOffset(topic11));
        assertNull(offsetCache.getOffset(topic12));
        assertEquals(5, offsetCache.getOffset(topic13));

        assertEquals(2, offsetCache.cacheSize());
    }