public static void main(String[] args) {
        final Server server = Server.builder()
                                    .service("/", (ctx, res) -> HttpResponse.of(""))
                                    .build();
        final Runnable whenClosing = () -> System.out.println("Before stopping Server");

        server.closeOnJvmShutdown(whenClosing).thenRun(() -> {
            System.out.println("After Server stopped");
        });
        server.start().join();
        System.exit(0);
    }
For checking the behavior of {@link Server#closeOnJvmShutdown()}.
This app must output the following text:
<pre>{@code
- Before stopping Server
- Server has been closed.
- After Server stopped
}</pre>
core/src/test/java/com/linecorp/armeria/server/ServerShutdownHookTest.java