@Override
    protected boolean matchesSafely(final Path item) {
        if (expected.size() != item.size()) {
            return false;
        }

        for (int ix = 0; ix < expected.size(); ix++) {
            if (!Objects.equals(expected.get(ix), item.get(ix))) {
                return false;
            }
        }
        return true;
    }
Add a custom {@code Matcher} class for {@link Path} objects that will ignore the path labels in the equality
comparison.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/IsPathEqualToMatcher.java