@Override
    public Node toNode() {
        return Node.objectNode()
                .withMember(PATH, Node.from(path))
                .withMember(EXPECTED, Node.from(expected))
                .withMember(COMPARATOR, comparator.toNode());
    }
Creates a new instance from a {@link Node}.

@param node Node tom create the PathMatcher from.
@return Returns the created PathMatcher.
@throws ExpectationNotMetException if the given Node is invalid.
smithy-waiters/src/main/java/software/amazon/smithy/waiters/PathMatcher.java