@Nonnull
    public static synchronized Thread getMainThread() {
        if (mainThread == null) {
            if (Bukkit.getServer().isPrimaryThread()) {
                mainThread = Thread.currentThread();
            }
        }
        return mainThread;
    }
To be used for testing only
helper/src/main/java/me/lucko/helper/internal/LoaderUtils.java