@Override
    public int hashCode() {
        int result = Objects.hash(super.hashCode(), returnType);
        // property keys' order does not matter because properties("x", "y"), and properties("y", "x") should be
        // considered identical.
        if (propertyKeys != null) {
            final List<String> sortedPropertyKeys = Arrays.stream(propertyKeys)
                    .sorted(Comparator.nullsLast(Comparator.naturalOrder())).collect(Collectors.toList());
            for (final String propertyKey : sortedPropertyKeys) {
                result = 31 * result + Objects.hashCode(propertyKey);
            }
        }
        return result;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PropertiesStep.java