private Stream<String> findDifferences(Node actual, Node expected, String prefix) {
        if (actual.equals(expected)) {
            return Stream.empty();
        }

        if (!actual.getType().equals(expected.getType())) {
            return Stream.of(String.format(
                    "[%s]: Expected node of type `%s` but found node of type `%s`.%n%nExpected: %s%n%n Found: %s",
                    prefix,
                    expected.getType(),
                    actual.getType(),
                    nodeToJson(expected, true),
                    nodeToJson(actual, true)));
        }

        switch (actual.getType()) {
            case OBJECT:
                return findDifferences(actual.expectObjectNode(), expected.expectObjectNode(), prefix);
            case ARRAY:
                return findDifferences(actual.expectArrayNode(), expected.expectArrayNode(), prefix);
            default:
                return Stream.of(String.format(
                        "[%s]: Expected `%s` but found `%s`",
                        prefix,
                        nodeToJson(expected, false),
                        nodeToJson(actual, false)));
        }
    }
Creates a line-by-line diff of two Node values.
smithy-model/src/main/java/software/amazon/smithy/model/node/NodeDiff.java