public Map<Long, ProducerStateEntry> activeProducers() {
        return Collections.unmodifiableMap(producers);
    }
@Test
    public void testAcceptAppendWithSequenceGapsOnReplica() {
        appendClientEntry(stateManager, producerId, epoch, defaultSequence, 0L, 0, false);
        int outOfOrderSequence = 3;

        // First we ensure that we raise an OutOfOrderSequenceException is raised when to append comes from a client.
        assertThrows(OutOfOrderSequenceException.class,
                () -> appendClientEntry(stateManager, producerId, epoch, outOfOrderSequence, 1L, 1, false));
        assertTrue(stateManager.activeProducers().containsKey(producerId));
        ProducerStateEntry producerStateEntry = stateManager.activeProducers().get(producerId);
        assertNotNull(producerStateEntry);
        assertEquals(0L, producerStateEntry.lastSeq());

        appendReplicationEntry(stateManager, epoch, outOfOrderSequence, 1L, 1);
        ProducerStateEntry producerStateEntryForReplication = stateManager.activeProducers().get(producerId);
        assertNotNull(producerStateEntryForReplication);
        assertEquals(outOfOrderSequence, producerStateEntryForReplication.lastSeq());
    }