private static int calcNewState(final ASTNode child, int state) {
    switch (state) {
      case BEFORE_FIRST -> {
        if (StdTokenSets.COMMENT_BIT_SET.contains(child.getElementType())) {
          return BEFORE_FIRST;
        }
        else if (child.getElementType() == JavaTokenType.LBRACE) {
          return INSIDE_BODY;
        }
        else {
          return BEFORE_LBRACE;
        }
      }
      case BEFORE_LBRACE -> {
        if (child.getElementType() == JavaTokenType.LBRACE) {
          return INSIDE_BODY;
        }
        else {
          return BEFORE_LBRACE;
        }
      }
    }
    return INSIDE_BODY;
  }
private static int calcNewState(final ASTNode child, int state)