code: public static JavaPlatform register(Config config) {
      // guard against multiple-registration (only in headless mode because this can happen when
      // running tests in Maven; in non-headless mode, we want to fail rather than silently ignore
      // erroneous repeated registration)
      if (config.headless && testInstance != null) {
        return testInstance;
      }
      JavaPlatform instance = new JavaPlatform(config);
      if (config.headless) {
        testInstance = instance;
      }
      PlayN.setPlatform(instance);
      return instance;
    }
docs: Registers the Java platform with the specified configuration.