default @NonNull Optional<T> tryCast(@NonNull Node node) {
        Objects.requireNonNull(node, "node");
        if (!matches(node)) {
            return Optional.empty();
        } else {
            return Optional.of(cast(node));
        }
    }
Attempts to cast the given {@link Node} to the type defined by the
{@link NodeType}.

<p>Returns an {@link Optional#empty() empty optional} if the node to cast
does not {@link #matches(Node) match} the type.</p>

@param node the node to cast
@return an optional, possibly containing a casted node
api/src/main/java/net/luckperms/api/node/NodeType.java