code: private static boolean matchingExitNode(Node n, Token type, @Nullable String labelName) {
      if (n.getToken() == type) {
        if (type == Token.RETURN) {
          // only returns without expressions.
          return !n.hasChildren();
        } else {
          if (labelName == null) {
            return !n.hasChildren();
          } else {
            return n.hasChildren()
              && labelName.equals(n.getFirstChild().getString());
          }
        }
      }
      return false;
    }
docs: Determines if n matches the type and name for the following types of
  "exits":
  - return without values
  - continues and breaks with or without names.
  @param n The node to inspect.
  @param type The Token type to look for.
  @param labelName The name that must be associated with the exit type.
  non-null only for breaks associated with labels.
  @return Whether the node matches the specified block-exit type.