private static <T> List<org.hamcrest.Matcher<? super T>> getMatchers(final T[] items) {
        final List<org.hamcrest.Matcher<? super T>> matchers = new ArrayList<>();

        for (int ix = 0; ix < items.length; ix++) {
            final T item = items[ix];

            // custom handle Path since we don't really want to assert the labels on the Path (i.e they aren't
            // part of the gherkin syntax)
            if (item instanceof Path) {
                matchers.add((org.hamcrest.Matcher<? super T>) new IsPathEqualToMatcher((Path) item));
            } else if (item instanceof Double && Double.isFinite((Double) item)) {
               // Allow for minor rounding errors with Double
               matchers.add((org.hamcrest.Matcher<? super T>) closeTo((Double) item, 0.000000000000001));
            } else {
                matchers.add(IsEqual.equalTo(item));
            }
        }
        return matchers;
    }
TinkerPop version of Hamcrest's {code in} that can use our custom assertions for {@link Path}.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java