@Test
    void unsuccessfulStartupTerminatesBossGroup() {
        final Predicate<ThreadInfo> predicate = info -> {
            final String name = info.getThreadName();
            return name.startsWith("armeria-boss-") && name.endsWith(":" + server.httpPort());
        };

        // When one port is open, there should be only one boss group thread.
        final long oldNumBossThreads =
                Arrays.stream(ManagementFactory.getThreadMXBean().dumpAllThreads(false, false))
                      .filter(predicate)
                      .count();
        assertThat(oldNumBossThreads).isOne();

        // Attempt to start another server at the same port.
        final Server serverAtSamePort =
                Server.builder()
                      .http(server.httpPort())
                      .service("/", (ctx, req) -> HttpResponse.of(200))
                      .build();

        // .. which will fail with an IOException.
        assertThatThrownBy(() -> serverAtSamePort.start().join())
                .isInstanceOf(CompletionException.class)
                .hasCauseInstanceOf(IOException.class);

        // A failed bind attempt must not leave a dangling boss group thread.
        final long numBossThreads =
                Arrays.stream(ManagementFactory.getThreadMXBean().dumpAllThreads(false, false))
                      .filter(predicate)
                      .count();
        assertThat(numBossThreads).isEqualTo(oldNumBossThreads);
    }
Ensures that the {@link Server} is always started when a test begins. This is necessary even if we
enabled auto-start for {@link ServerRule} because we stop it in {@link #testStartStop()}.
core/src/test/java/com/linecorp/armeria/server/ServerTest.java