ElementHelper { public static Set<String> getKeys(final Object... keyValues) { final Set<String> keys = new HashSet<>(); for (int i = 0; i < keyValues.length; i = i + 2) { keys.add(keyValues[i].toString()); } return keys; } private  ElementHelper(); static void validateLabel(final String label); static void validateMixedElementIds(final Class<? extends Element> clazz, final Object... ids); static void validateProperty(final String key, final Object value); static void legalPropertyKeyValueArray(final Object... propertyKeyValues); static Optional<Object> getIdValue(final Object... keyValues); static Optional<Object[]> remove(final String keyToRemove, final Object... keyValues); static Optional<Object[]> remove(final T accessor, final Object... keyValues); static Object[] upsert(final Object[] keyValues, final Object key, final Object val); static Object[] replaceKey(final Object[] keyValues, final Object oldKey, final Object newKey); static Map<String, Object> asMap(final Object... keyValues); static List<Pair<String, Object>> asPairs(final Object... keyValues); static Set<String> getKeys(final Object... keyValues); static Optional<String> getLabelValue(final Object... keyValues); static void attachProperties(final Element element, final Object... propertyKeyValues); static void attachProperties(final Vertex vertex, final Object... propertyKeyValues); static void attachProperties(final Vertex vertex, final VertexProperty.Cardinality cardinality,
                                        final Object... propertyKeyValues); static Optional<VertexProperty<V>> stageVertexProperty(final Vertex vertex,
                                                                      final VertexProperty.Cardinality cardinality,
                                                                      final String key, final V value, final Object... keyValues); static Object[] getProperties(final Element element, final boolean includeId, final boolean includeLabel, final Set<String> propertiesToCopy); static boolean areEqual(final Element a, final Object b); static boolean areEqual(final Vertex a, final Vertex b); static boolean areEqual(final Edge a, final Edge b); static boolean areEqual(final VertexProperty a, final VertexProperty b); static boolean areEqual(final VertexProperty a, final Object b); static boolean haveEqualIds(final Element a, final Element b); static int hashCode(final Element element); static int hashCode(final Property property); static boolean areEqual(final Property a, final Object b); static Map<String, Object> propertyValueMap(final Element element, final String... propertyKeys); static Map<String, Property> propertyMap(final Element element, final String... propertyKeys); static Map<String, List> vertexPropertyValueMap(final Vertex vertex, final String... propertyKeys); static Map<String, List<VertexProperty>> vertexPropertyMap(final Vertex vertex, final String... propertyKeys); static boolean keyExists(final String key, final String... providedKeys); static boolean idExists(final Object id, final Object... providedIds);  }
@Test public void shouldExtractKeys() { final Set<String> keys = ElementHelper.getKeys("test1", "something", "test2", "something else"); assertTrue(keys.contains("test1")); assertTrue(keys.contains("test2")); }