@Test
    public void testClaimsLeadership() throws Exception {
        try (
            LocalLogManagerTestEnv env = new LocalLogManagerTestEnv.Builder(1).
                    buildWithMockListeners()
        ) {
            assertEquals(new LeaderAndEpoch(OptionalInt.of(0), 1), env.waitForLeader());
            env.close();
            assertNull(env.firstError.get());
        }
    }
Test that the local log manager will claim leadership.
metadata/src/test/java/org/apache/kafka/metalog/LocalLogManagerTest.java