public static Object[] getProperties(final Element element, final boolean includeId, final boolean includeLabel, final Set<String> propertiesToCopy) {
        final List<Object> keyValues = new ArrayList<>();
        if (includeId) {
            keyValues.add(T.id);
            keyValues.add(element.id());
        }
        if (includeLabel) {
            keyValues.add(T.label);
            keyValues.add(element.label());
        }
        element.keys().forEach(key -> {
            if (propertiesToCopy.isEmpty() || propertiesToCopy.contains(key)) {
                keyValues.add(key);
                keyValues.add(element.value(key));
            }
        });
        return keyValues.toArray(new Object[keyValues.size()]);
    }
Retrieve the properties associated with a particular element.
The result is a Object[] where odd indices are String keys and even indices are the values.

@param element          the element to retrieve properties from
@param includeId        include Element.ID in the key/value list
@param includeLabel     include Element.LABEL in the key/value list
@param propertiesToCopy the properties to include with an empty list meaning copy all properties
@return a key/value array of properties where odd indices are String keys and even indices are the values.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java