class TestHackHelper {

  private TestHackHelper() {
  }

  public static boolean isJUnitTest() {<FILL_FUNCTION_BODY>}
}

    StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
    for (StackTraceElement element : stackTrace) {
      if (element.getClassName().startsWith("org.junit.") ||
              element.getClassName().equals("org.languagetool.rules.patterns.PatternRuleTest")) {
        return true;
      }
    }
    return false;
  
<no_super_class>