public static Expectation fromNode(Node node) {
        ObjectNode o = node.expectObjectNode();
        if (o.containsMember(SUCCESS)) {
            o.expectNoAdditionalProperties(ListUtils.of(SUCCESS));
            return Expectation.success();
        } else if (o.containsMember(FAILURE)) {
            o.expectNoAdditionalProperties(ListUtils.of(FAILURE));
            FailureExpectation failure = FailureExpectation.fromNode(o.expectObjectMember(FAILURE));
            return Expectation.failure(failure);
        } else {
            throw new ExpectationNotMetException("Expected an object with exactly one `" + SUCCESS + "` or `" + FAILURE
                    + "` property, but found properties: " + ValidationUtils.tickedList(o.getStringMap().keySet()), o);
        }
    }
Creates a {@link Expectation} from a {@link Node}.

@param node Node to deserialize into a {@link Expectation}.
@return Returns the created {@link Expectation}.
smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits/Expectation.java