public static void attachProperties(final Element element, final Object... propertyKeyValues) {
        if (null == element)
            throw Graph.Exceptions.argumentCanNotBeNull("element");

        final boolean allowNullPropertyValues = element instanceof Vertex ?
                element.graph().features().vertex().supportsNullPropertyValues() : element instanceof Edge ?
                element.graph().features().edge().supportsNullPropertyValues() :
                element.graph().features().vertex().properties().supportsNullPropertyValues();

        for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
            if (!propertyKeyValues[i].equals(T.id) && !propertyKeyValues[i].equals(T.label))
                if (!allowNullPropertyValues && null == propertyKeyValues[i + 1])
                    element.properties(((String) propertyKeyValues[i])).forEachRemaining(Property::remove);
                else
                    element.property((String) propertyKeyValues[i], propertyKeyValues[i + 1]);
        }
    }
Assign key/value pairs as properties to an {@link Element}.  If the value of {@link T#id} or
{@link T#label} is in the set of pairs, then they are ignored.

@param element           the graph element to assign the {@code propertyKeyValues}
@param propertyKeyValues the key/value pairs to assign to the {@code element}
@throws ClassCastException       if the value of the key is not a {@link String}
@throws IllegalArgumentException if the value of {@code element} is null
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java