package spark;

import static spark.Service.ignite;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

public class InitExceptionHandlerTest {

    private static int NON_VALID_PORT = Integer.MAX_VALUE;
    private static Service service;
    private static String errorMessage = "";

    @BeforeClass
    public static void setUpClass() throws Exception {
        service = ignite();
        service.port(NON_VALID_PORT);
        service.initExceptionHandler((e) -> errorMessage = "Custom init error");
        service.init();
        service.awaitInitialization();
    }

    @Test
    public void testInitExceptionHandler() throws Exception {
        Assert.assertEquals("Custom init error", errorMessage);
    }

    @AfterClass
    public static void tearDown() throws Exception {
        service.stop();
    }

}

@@ -13,45 +13,8 @@
 k;%0A%0A
-import static spark.Service.ignite;%0A%0A
 impo
@@ -117,16 +117,53 @@
 .Test;%0A%0A
+import static spark.Service.ignite;%0A%0A
 public c

Fix imports