public LeaderAndIsr newLeader(int leader) {
        return newLeaderAndIsrWithBrokerEpoch(leader, isrWithBrokerEpoch);
    }
@Test
    public void testNewLeader() {
        LeaderAndIsr leaderAndIsr = new LeaderAndIsr(2, Arrays.asList(1, 2, 3));

        assertEquals(2, leaderAndIsr.leader());
        assertEquals(Arrays.asList(1, 2, 3), leaderAndIsr.isr());

        LeaderAndIsr newLeaderAndIsr = leaderAndIsr.newLeader(3);

        assertEquals(3, newLeaderAndIsr.leader());
        assertEquals(Arrays.asList(1, 2, 3), newLeaderAndIsr.isr());
    }