code: protected boolean isMain(Thread thread) {
  		return thread.getName().equals("main") && thread.getContextClassLoader()
  				.getClass().getName().contains("AppClassLoader");
  	}
docs: Returns if the thread is for a main invocation. By default checks the name of the
  thread and the context classloader.
  @param thread the thread to check
  @return {@code true} if the thread is a main invocation