// Path: src/main/java/com/blazegraph/gremlin/util/CloseableIterator.java
// public interface CloseableIterator<E> extends Iterator<E>, AutoCloseable {
//     
//     /**
//      * You MUST close this iterator or auto-close with a try-with-resources.
//      */
//     @Override
//     void close();
//     
//     /**
//      * Perform some action on each remaining element and then close the itertor.
//      */
//     @Override
//     default void forEachRemaining(Consumer<? super E> action) {
//         try {
//             Iterator.super.forEachRemaining(action);
//         } finally {
//             close();
//         }
//     }
// 
//     /**
//      * You MUST close this stream or auto-close in a try-with-resources.
//      */
//     default Stream<E> stream() {
//         return Streams.of(this).onClose(() -> close());
//     }
//     
//     /**
//      * Collect the elements into a list. This will close the iterator.
//      */
//     default List<E> collect() {
//         try (Stream<E> s = stream()) {
//             return s.collect(toList());
//         }
//     }
//     
//     /**
//      * Count the elements. This will close the iterator.
//      */
//     default long count() {
//         try (Stream<E> s = stream()) {
//             return s.count();
//         }
//     }
//     
//     /**
//      * Count the distinct elements.  This will close the iterator.
//      */
//     default long countDistinct() {
//         try (Stream<E> s = stream()) {
//             return s.distinct().count();
//         }
//     }
//     
//     /**
//      * Construct an instance from a stream using stream.close() as the close
//      * behavior for the iterator.
//      */
//     public static <T> CloseableIterator<T> of(final Stream<T> stream) {
//         return of(stream.iterator(), () -> stream.close());
//     }
//     
//     /**
//      * Construct an instance from the supplied iterator and the supplied
//      * onClose behavior.
//      */
//     public static <T> 
//     CloseableIterator<T> of(final Iterator<T> it, final Runnable onClose) {
//         return new CloseableIterator<T>() {
// 
//             @Override
//             public boolean hasNext() { 
//                 return it.hasNext(); 
//             }
// 
//             @Override
//             public T next() { 
//                 return it.next(); 
//             }
//             
//             @Override
//             public void remove() {
//                 it.remove();
//             }
//             
//             @Override
//             public void close() { 
//                 onClose.run(); 
//             }
//             
//             @Override
//             public void forEachRemaining(Consumer<? super T> action) {
//                 it.forEachRemaining(action);
//             }
// 
//         };
//     }
//     
//     /**
//      * Empty instance.
//      */
//     public static <T> CloseableIterator<T> emptyIterator() {
//         final Iterator<T> it = Collections.<T>emptyIterator();
//         return of(it, () -> {});
//     }
// 
// }


import org.openrdf.model.URI;
import com.bigdata.rdf.model.BigdataBNode;
import com.blazegraph.gremlin.util.CloseableIterator;
import java.util.NoSuchElementException;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.openrdf.model.Literal;
    /**
     * @see Property#isPresent()
     */
    @Override
    public boolean isPresent() {
        return prop.isPresent();
    }

    /**
     * @see Property#remove()
     * @see BlazeGraph#remove(BlazeReifiedElement)
     */
    @Override
    public void remove() {
        graph().remove(this);
    }

    /**
     * Strengthen return type to {@link BlazeProperty}.
     */
    @Override
    public <U> BlazeProperty<U> property(final String key, final U val) {
        return BlazeReifiedElement.super.property(key, val);
    }

    /**
     * Strength return type to {@link CloseableIterator}.  You MUST close this
     * iterator when finished.
     */
    @Override
// Path: src/main/java/com/blazegraph/gremlin/util/CloseableIterator.java
// public interface CloseableIterator<E> extends Iterator<E>, AutoCloseable {
//     
//     /**
//      * You MUST close this iterator or auto-close with a try-with-resources.
//      */
//     @Override
//     void close();
//     
//     /**
//      * Perform some action on each remaining element and then close the itertor.
//      */
//     @Override
//     default void forEachRemaining(Consumer<? super E> action) {
//         try {
//             Iterator.super.forEachRemaining(action);
//         } finally {
//             close();
//         }
//     }
// 
//     /**
//      * You MUST close this stream or auto-close in a try-with-resources.
//      */
//     default Stream<E> stream() {
//         return Streams.of(this).onClose(() -> close());
//     }
//     
//     /**
//      * Collect the elements into a list. This will close the iterator.
//      */
//     default List<E> collect() {
//         try (Stream<E> s = stream()) {
//             return s.collect(toList());
//         }
//     }
//     
//     /**
//      * Count the elements. This will close the iterator.
//      */
//     default long count() {
//         try (Stream<E> s = stream()) {
//             return s.count();
//         }
//     }
//     
//     /**
//      * Count the distinct elements.  This will close the iterator.
//      */
//     default long countDistinct() {
//         try (Stream<E> s = stream()) {
//             return s.distinct().count();
//         }
//     }
//     
//     /**
//      * Construct an instance from a stream using stream.close() as the close
//      * behavior for the iterator.
//      */
//     public static <T> CloseableIterator<T> of(final Stream<T> stream) {
//         return of(stream.iterator(), () -> stream.close());
//     }
//     
//     /**
//      * Construct an instance from the supplied iterator and the supplied
//      * onClose behavior.
//      */
//     public static <T> 
//     CloseableIterator<T> of(final Iterator<T> it, final Runnable onClose) {
//         return new CloseableIterator<T>() {
// 
//             @Override
//             public boolean hasNext() { 
//                 return it.hasNext(); 
//             }
// 
//             @Override
//             public T next() { 
//                 return it.next(); 
//             }
//             
//             @Override
//             public void remove() {
//                 it.remove();
//             }
//             
//             @Override
//             public void close() { 
//                 onClose.run(); 
//             }
//             
//             @Override
//             public void forEachRemaining(Consumer<? super T> action) {
//                 it.forEachRemaining(action);
//             }
// 
//         };
//     }
//     
//     /**
//      * Empty instance.
//      */
//     public static <T> CloseableIterator<T> emptyIterator() {
//         final Iterator<T> it = Collections.<T>emptyIterator();
//         return of(it, () -> {});
//     }
// 
// }


// Path: src/main/java/com/blazegraph/gremlin/structure/BlazeVertexProperty.java
import org.openrdf.model.URI;
import com.bigdata.rdf.model.BigdataBNode;
import com.blazegraph.gremlin.util.CloseableIterator;
import java.util.NoSuchElementException;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.openrdf.model.Literal;

    /**
     * @see Property#isPresent()
     */
    @Override
    public boolean isPresent() {
        return prop.isPresent();
    }

    /**
     * @see Property#remove()
     * @see BlazeGraph#remove(BlazeReifiedElement)
     */
    @Override
    public void remove() {
        graph().remove(this);
    }

    /**
     * Strengthen return type to {@link BlazeProperty}.
     */
    @Override
    public <U> BlazeProperty<U> property(final String key, final U val) {
        return BlazeReifiedElement.super.property(key, val);
    }

    /**
     * Strength return type to {@link CloseableIterator}.  You MUST close this
     * iterator when finished.
     */
    @Override
    public <U> CloseableIterator<Property<U>> properties(final String... keys) {