From 03ac332661cbae30941223a37eeba3ea499c722b Mon Sep 17 00:00:00 2001
From: michele <michele@cheergg.com>
Date: Wed, 4 Sep 2019 14:33:16 +0200
Subject: [PATCH 1/2] async package

---
 .../{ => async}/ArangoCollectionAsync.java    |   10 +-
 .../{ => async}/ArangoCursorAsync.java        |    4 +-
 .../arangodb/{ => async}/ArangoDBAsync.java   |   47 +-
 .../{ => async}/ArangoDatabaseAsync.java      |   12 +-
 .../ArangoEdgeCollectionAsync.java            |    7 +-
 .../{ => async}/ArangoGraphAsync.java         |    9 +-
 .../{ => async}/ArangoRouteAsync.java         |    7 +-
 .../{ => async}/ArangoSearchAsync.java        |    6 +-
 .../ArangoVertexCollectionAsync.java          |    7 +-
 .../arangodb/{ => async}/ArangoViewAsync.java |    7 +-
 .../internal/ArangoCollectionAsyncImpl.java   |    5 +-
 .../internal/ArangoCursorAsyncImpl.java       |   14 +-
 .../internal/ArangoDBAsyncImpl.java           |   24 +-
 .../internal/ArangoDatabaseAsyncImpl.java     |   24 +-
 .../ArangoEdgeCollectionAsyncImpl.java        |    9 +-
 .../internal/ArangoExecutorAsync.java         |   10 +-
 .../internal/ArangoGraphAsyncImpl.java        |   15 +-
 .../internal/ArangoRouteAsyncImpl.java        |   11 +-
 .../internal/ArangoSearchAsyncImpl.java       |    9 +-
 .../ArangoVertexCollectionAsyncImpl.java      |    9 +-
 .../internal/ArangoViewAsyncImpl.java         |    9 +-
 .../velocystream/VstCommunicationAsync.java   |    3 +-
 .../velocystream/VstConnectionAsync.java      |   15 +-
 .../VstConnectionFactoryAsync.java            |    6 +-
 .../{ => async}/ArangoCollectionTest.java     |    3 +-
 .../arangodb/{ => async}/ArangoDBTest.java    | 1057 +++++++--------
 .../{ => async}/ArangoDatabaseTest.java       |    3 +-
 .../{ => async}/ArangoEdgeCollectionTest.java |  774 ++++++-----
 .../arangodb/{ => async}/ArangoGraphTest.java |    2 +-
 .../arangodb/{ => async}/ArangoRouteTest.java |   16 +-
 .../{ => async}/ArangoSearchTest.java         |    3 +-
 .../arangodb/{ => async}/ArangoSslTest.java   |  187 ++-
 .../ArangoVertexCollectionTest.java           |  744 +++++------
 .../arangodb/{ => async}/ArangoViewTest.java  |    2 +-
 .../com/arangodb/{ => async}/BaseTest.java    |    2 +-
 .../{ => async}/CommunicationTest.java        |   94 +-
 .../arangodb/{ => async}/ConcurrencyTest.java |    4 +-
 .../ConcurrentStreamTransactionsTest.java     |    3 +-
 .../{ => async}/StreamTransactionTest.java    |    3 +-
 .../debug/ConsolidationIntervalMsec.java      |    6 +-
 .../{ => async}/example/ExampleBase.java      |  123 +-
 ...AqlQueryWithSpecialReturnTypesExample.java |  276 ++--
 .../example/document/GetDocumentExample.java  |   21 +-
 .../document/ImportDocumentExample.java       |    4 +-
 .../document/InsertDocumentExample.java       |  144 +-
 .../example/document/TestEntity.java          |   98 +-
 .../graph/AQLActorsAndMoviesExample.java      | 1165 ++++++++---------
 .../example/graph/BaseGraphTest.java          |  225 ++--
 .../{ => async}/example/graph/Circle.java     |    2 +-
 .../{ => async}/example/graph/CircleEdge.java |    2 +-
 .../graph/GraphTraversalsInAQLExample.java    |   13 +-
 .../graph/ShortestPathInAQLExample.java       |   13 +-
 .../{ => async}/example/ssl/SslExample.java   |  156 ++-
 .../example/velocypack/VPackExample.java      |  229 ++--
 .../{ => async}/serde/CustomSerdeTest.java    |    7 +-
 55 files changed, 2827 insertions(+), 2833 deletions(-)
 rename src/main/java/com/arangodb/{ => async}/ArangoCollectionAsync.java (99%)
 rename src/main/java/com/arangodb/{ => async}/ArangoCursorAsync.java (93%)
 rename src/main/java/com/arangodb/{ => async}/ArangoDBAsync.java (96%)
 rename src/main/java/com/arangodb/{ => async}/ArangoDatabaseAsync.java (99%)
 rename src/main/java/com/arangodb/{ => async}/ArangoEdgeCollectionAsync.java (98%)
 rename src/main/java/com/arangodb/{ => async}/ArangoGraphAsync.java (98%)
 rename src/main/java/com/arangodb/{ => async}/ArangoRouteAsync.java (97%)
 rename src/main/java/com/arangodb/{ => async}/ArangoSearchAsync.java (99%)
 rename src/main/java/com/arangodb/{ => async}/ArangoVertexCollectionAsync.java (98%)
 rename src/main/java/com/arangodb/{ => async}/ArangoViewAsync.java (96%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoCollectionAsyncImpl.java (99%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoCursorAsyncImpl.java (84%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoDBAsyncImpl.java (93%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoDatabaseAsyncImpl.java (98%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoEdgeCollectionAsyncImpl.java (95%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoExecutorAsync.java (88%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoGraphAsyncImpl.java (93%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoRouteAsyncImpl.java (95%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoSearchAsyncImpl.java (95%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoVertexCollectionAsyncImpl.java (95%)
 rename src/main/java/com/arangodb/{ => async}/internal/ArangoViewAsyncImpl.java (92%)
 rename src/main/java/com/arangodb/{ => async}/internal/velocystream/VstCommunicationAsync.java (98%)
 rename src/main/java/com/arangodb/{ => async}/internal/velocystream/VstConnectionAsync.java (98%)
 rename src/main/java/com/arangodb/{ => async}/internal/velocystream/VstConnectionFactoryAsync.java (96%)
 rename src/test/java/com/arangodb/{ => async}/ArangoCollectionTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/ArangoDBTest.java (97%)
 rename src/test/java/com/arangodb/{ => async}/ArangoDatabaseTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/ArangoEdgeCollectionTest.java (96%)
 rename src/test/java/com/arangodb/{ => async}/ArangoGraphTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/ArangoRouteTest.java (97%)
 rename src/test/java/com/arangodb/{ => async}/ArangoSearchTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/ArangoSslTest.java (96%)
 rename src/test/java/com/arangodb/{ => async}/ArangoVertexCollectionTest.java (97%)
 rename src/test/java/com/arangodb/{ => async}/ArangoViewTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/BaseTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/CommunicationTest.java (94%)
 rename src/test/java/com/arangodb/{ => async}/ConcurrencyTest.java (96%)
 rename src/test/java/com/arangodb/{ => async}/ConcurrentStreamTransactionsTest.java (98%)
 rename src/test/java/com/arangodb/{ => async}/StreamTransactionTest.java (99%)
 rename src/test/java/com/arangodb/{ => async}/debug/ConsolidationIntervalMsec.java (95%)
 rename src/test/java/com/arangodb/{ => async}/example/ExampleBase.java (89%)
 rename src/test/java/com/arangodb/{ => async}/example/document/AqlQueryWithSpecialReturnTypesExample.java (96%)
 rename src/test/java/com/arangodb/{ => async}/example/document/GetDocumentExample.java (97%)
 rename src/test/java/com/arangodb/{ => async}/example/document/ImportDocumentExample.java (96%)
 rename src/test/java/com/arangodb/{ => async}/example/document/InsertDocumentExample.java (94%)
 rename src/test/java/com/arangodb/{ => async}/example/document/TestEntity.java (92%)
 rename src/test/java/com/arangodb/{ => async}/example/graph/AQLActorsAndMoviesExample.java (97%)
 rename src/test/java/com/arangodb/{ => async}/example/graph/BaseGraphTest.java (95%)
 rename src/test/java/com/arangodb/{ => async}/example/graph/Circle.java (97%)
 rename src/test/java/com/arangodb/{ => async}/example/graph/CircleEdge.java (98%)
 rename src/test/java/com/arangodb/{ => async}/example/graph/GraphTraversalsInAQLExample.java (98%)
 rename src/test/java/com/arangodb/{ => async}/example/graph/ShortestPathInAQLExample.java (97%)
 rename src/test/java/com/arangodb/{ => async}/example/ssl/SslExample.java (94%)
 rename src/test/java/com/arangodb/{ => async}/example/velocypack/VPackExample.java (95%)
 rename src/test/java/com/arangodb/{ => async}/serde/CustomSerdeTest.java (96%)

diff --git a/src/main/java/com/arangodb/ArangoCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java
similarity index 99%
rename from src/main/java/com/arangodb/ArangoCollectionAsync.java
rename to src/main/java/com/arangodb/async/ArangoCollectionAsync.java
index 826f86e..ab17217 100644
--- a/src/main/java/com/arangodb/ArangoCollectionAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java
@@ -18,14 +18,16 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.Collection;
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.entity.*;
 import com.arangodb.model.*;
 
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB collection level.
  * 
diff --git a/src/main/java/com/arangodb/ArangoCursorAsync.java b/src/main/java/com/arangodb/async/ArangoCursorAsync.java
similarity index 93%
rename from src/main/java/com/arangodb/ArangoCursorAsync.java
rename to src/main/java/com/arangodb/async/ArangoCursorAsync.java
index 1f0343d..ccc5687 100644
--- a/src/main/java/com/arangodb/ArangoCursorAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoCursorAsync.java
@@ -18,7 +18,9 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
+
+import com.arangodb.ArangoCursor;
 
 import java.util.stream.Stream;
 
diff --git a/src/main/java/com/arangodb/ArangoDBAsync.java b/src/main/java/com/arangodb/async/ArangoDBAsync.java
similarity index 96%
rename from src/main/java/com/arangodb/ArangoDBAsync.java
rename to src/main/java/com/arangodb/async/ArangoDBAsync.java
index 8d7aa44..50960ac 100644
--- a/src/main/java/com/arangodb/ArangoDBAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoDBAsync.java
@@ -18,24 +18,16 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.util.Collection;
-import java.util.concurrent.CompletableFuture;
-
-import javax.net.ssl.SSLContext;
-
-import com.arangodb.entity.ArangoDBVersion;
-import com.arangodb.entity.LoadBalancingStrategy;
-import com.arangodb.entity.LogEntity;
-import com.arangodb.entity.LogLevelEntity;
-import com.arangodb.entity.Permissions;
-import com.arangodb.entity.ServerRole;
-import com.arangodb.entity.UserEntity;
+package com.arangodb.async;
+
+import com.arangodb.ArangoDBException;
+import com.arangodb.ArangoSerializationAccessor;
+import com.arangodb.Protocol;
+import com.arangodb.async.internal.ArangoDBAsyncImpl;
+import com.arangodb.async.internal.velocystream.VstCommunicationAsync;
+import com.arangodb.async.internal.velocystream.VstConnectionFactoryAsync;
+import com.arangodb.entity.*;
 import com.arangodb.internal.ArangoContext;
-import com.arangodb.internal.ArangoDBAsyncImpl;
 import com.arangodb.internal.ArangoDefaults;
 import com.arangodb.internal.InternalArangoDBBuilder;
 import com.arangodb.internal.net.ConnectionFactory;
@@ -45,30 +37,23 @@
 import com.arangodb.internal.util.ArangoSerializationFactory;
 import com.arangodb.internal.util.ArangoSerializerImpl;
 import com.arangodb.internal.util.DefaultArangoSerialization;
-import com.arangodb.internal.velocystream.VstCommunicationAsync;
 import com.arangodb.internal.velocystream.VstCommunicationSync;
-import com.arangodb.internal.velocystream.VstConnectionFactoryAsync;
 import com.arangodb.model.LogOptions;
 import com.arangodb.model.UserCreateOptions;
 import com.arangodb.model.UserUpdateOptions;
 import com.arangodb.util.ArangoDeserializer;
 import com.arangodb.util.ArangoSerialization;
 import com.arangodb.util.ArangoSerializer;
-import com.arangodb.velocypack.VPack;
-import com.arangodb.velocypack.VPackAnnotationFieldFilter;
-import com.arangodb.velocypack.VPackAnnotationFieldNaming;
-import com.arangodb.velocypack.VPackDeserializer;
-import com.arangodb.velocypack.VPackInstanceCreator;
-import com.arangodb.velocypack.VPackJsonDeserializer;
-import com.arangodb.velocypack.VPackJsonSerializer;
-import com.arangodb.velocypack.VPackModule;
-import com.arangodb.velocypack.VPackParser;
-import com.arangodb.velocypack.VPackParserModule;
-import com.arangodb.velocypack.VPackSerializer;
-import com.arangodb.velocypack.ValueType;
+import com.arangodb.velocypack.*;
 import com.arangodb.velocystream.Request;
 import com.arangodb.velocystream.Response;
 
+import javax.net.ssl.SSLContext;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Central access point for applications to communicate with an ArangoDB server.
  * 
diff --git a/src/main/java/com/arangodb/ArangoDatabaseAsync.java b/src/main/java/com/arangodb/async/ArangoDatabaseAsync.java
similarity index 99%
rename from src/main/java/com/arangodb/ArangoDatabaseAsync.java
rename to src/main/java/com/arangodb/async/ArangoDatabaseAsync.java
index ab3a65a..ddf0e39 100644
--- a/src/main/java/com/arangodb/ArangoDatabaseAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoDatabaseAsync.java
@@ -18,18 +18,20 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.entity.*;
 import com.arangodb.entity.arangosearch.AnalyzerEntity;
 import com.arangodb.model.*;
 import com.arangodb.model.arangosearch.AnalyzerDeleteOptions;
 import com.arangodb.model.arangosearch.ArangoSearchCreateOptions;
 
+import java.util.Collection;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB database level.
  *
diff --git a/src/main/java/com/arangodb/ArangoEdgeCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java
similarity index 98%
rename from src/main/java/com/arangodb/ArangoEdgeCollectionAsync.java
rename to src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java
index 395286a..d105774 100644
--- a/src/main/java/com/arangodb/ArangoEdgeCollectionAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java
@@ -18,14 +18,15 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.entity.EdgeEntity;
 import com.arangodb.entity.EdgeUpdateEntity;
 import com.arangodb.model.*;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB edge collection level.
  * 
diff --git a/src/main/java/com/arangodb/ArangoGraphAsync.java b/src/main/java/com/arangodb/async/ArangoGraphAsync.java
similarity index 98%
rename from src/main/java/com/arangodb/ArangoGraphAsync.java
rename to src/main/java/com/arangodb/async/ArangoGraphAsync.java
index c4aa83f..c2a5886 100644
--- a/src/main/java/com/arangodb/ArangoGraphAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoGraphAsync.java
@@ -18,15 +18,16 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.Collection;
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.entity.EdgeDefinition;
 import com.arangodb.entity.GraphEntity;
 import com.arangodb.model.GraphCreateOptions;
 
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB graph level.
  * 
diff --git a/src/main/java/com/arangodb/ArangoRouteAsync.java b/src/main/java/com/arangodb/async/ArangoRouteAsync.java
similarity index 97%
rename from src/main/java/com/arangodb/ArangoRouteAsync.java
rename to src/main/java/com/arangodb/async/ArangoRouteAsync.java
index 0a69451..cf7d7bc 100644
--- a/src/main/java/com/arangodb/ArangoRouteAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoRouteAsync.java
@@ -18,13 +18,14 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.velocypack.VPackSlice;
 import com.arangodb.velocystream.Response;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for a specific path to be used to perform arbitrary requests.
  * 
diff --git a/src/main/java/com/arangodb/ArangoSearchAsync.java b/src/main/java/com/arangodb/async/ArangoSearchAsync.java
similarity index 99%
rename from src/main/java/com/arangodb/ArangoSearchAsync.java
rename to src/main/java/com/arangodb/async/ArangoSearchAsync.java
index 9dae974..657239c 100644
--- a/src/main/java/com/arangodb/ArangoSearchAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoSearchAsync.java
@@ -18,15 +18,15 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
 import com.arangodb.entity.ViewEntity;
 import com.arangodb.entity.arangosearch.ArangoSearchPropertiesEntity;
 import com.arangodb.model.arangosearch.ArangoSearchCreateOptions;
 import com.arangodb.model.arangosearch.ArangoSearchPropertiesOptions;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB view level for ArangoSearch views.
  * 
diff --git a/src/main/java/com/arangodb/ArangoVertexCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java
similarity index 98%
rename from src/main/java/com/arangodb/ArangoVertexCollectionAsync.java
rename to src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java
index 7167515..d542ca0 100644
--- a/src/main/java/com/arangodb/ArangoVertexCollectionAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java
@@ -18,14 +18,15 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.entity.VertexEntity;
 import com.arangodb.entity.VertexUpdateEntity;
 import com.arangodb.model.*;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB vertex collection level.
  * 
diff --git a/src/main/java/com/arangodb/ArangoViewAsync.java b/src/main/java/com/arangodb/async/ArangoViewAsync.java
similarity index 96%
rename from src/main/java/com/arangodb/ArangoViewAsync.java
rename to src/main/java/com/arangodb/async/ArangoViewAsync.java
index a80689e..9abee19 100644
--- a/src/main/java/com/arangodb/ArangoViewAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoViewAsync.java
@@ -18,12 +18,13 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
-
-import java.util.concurrent.CompletableFuture;
+package com.arangodb.async;
 
+import com.arangodb.ArangoSerializationAccessor;
 import com.arangodb.entity.ViewEntity;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * Interface for operations on ArangoDB view level.
  * 
diff --git a/src/main/java/com/arangodb/internal/ArangoCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java
similarity index 99%
rename from src/main/java/com/arangodb/internal/ArangoCollectionAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java
index cb4c0e7..3dd93e0 100644
--- a/src/main/java/com/arangodb/internal/ArangoCollectionAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java
@@ -18,11 +18,12 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import com.arangodb.ArangoCollectionAsync;
 import com.arangodb.ArangoDBException;
+import com.arangodb.async.ArangoCollectionAsync;
 import com.arangodb.entity.*;
+import com.arangodb.internal.InternalArangoCollection;
 import com.arangodb.internal.util.DocumentUtil;
 import com.arangodb.model.*;
 
diff --git a/src/main/java/com/arangodb/internal/ArangoCursorAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java
similarity index 84%
rename from src/main/java/com/arangodb/internal/ArangoCursorAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java
index 73e5336..3ae9ec2 100644
--- a/src/main/java/com/arangodb/internal/ArangoCursorAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java
@@ -18,16 +18,18 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
+
+import com.arangodb.async.ArangoCursorAsync;
+import com.arangodb.entity.CursorEntity;
+import com.arangodb.internal.ArangoCursorExecute;
+import com.arangodb.internal.InternalArangoDatabase;
+import com.arangodb.internal.cursor.ArangoCursorImpl;
 
 import java.util.Spliterators;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
 
-import com.arangodb.ArangoCursorAsync;
-import com.arangodb.entity.CursorEntity;
-import com.arangodb.internal.cursor.ArangoCursorImpl;
-
 /**
  * @author Mark Vollmary
  *
@@ -35,7 +37,7 @@
 public class ArangoCursorAsyncImpl<T> extends ArangoCursorImpl<T> implements ArangoCursorAsync<T> {
 
 	protected ArangoCursorAsyncImpl(final InternalArangoDatabase<?, ?> db, final ArangoCursorExecute execute,
-		final Class<T> type, final CursorEntity result) {
+									final Class<T> type, final CursorEntity result) {
 		super(db, execute, type, result);
 	}
 
diff --git a/src/main/java/com/arangodb/internal/ArangoDBAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoDBAsyncImpl.java
similarity index 93%
rename from src/main/java/com/arangodb/internal/ArangoDBAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoDBAsyncImpl.java
index 47848ee..32e5f78 100644
--- a/src/main/java/com/arangodb/internal/ArangoDBAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoDBAsyncImpl.java
@@ -18,27 +18,19 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.io.IOException;
-import java.util.Collection;
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoDBAsync;
 import com.arangodb.ArangoDBException;
-import com.arangodb.ArangoDatabaseAsync;
-import com.arangodb.entity.ArangoDBVersion;
-import com.arangodb.entity.LogEntity;
-import com.arangodb.entity.LogLevelEntity;
-import com.arangodb.entity.Permissions;
-import com.arangodb.entity.ServerRole;
-import com.arangodb.entity.UserEntity;
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.async.ArangoDatabaseAsync;
+import com.arangodb.async.internal.velocystream.VstCommunicationAsync;
+import com.arangodb.entity.*;
+import com.arangodb.internal.*;
 import com.arangodb.internal.net.CommunicationProtocol;
 import com.arangodb.internal.net.HostResolver;
 import com.arangodb.internal.util.ArangoSerializationFactory;
 import com.arangodb.internal.util.ArangoSerializationFactory.Serializer;
 import com.arangodb.internal.velocystream.VstCommunication;
-import com.arangodb.internal.velocystream.VstCommunicationAsync;
 import com.arangodb.internal.velocystream.VstCommunicationSync;
 import com.arangodb.internal.velocystream.VstProtocol;
 import com.arangodb.internal.velocystream.internal.VstConnectionSync;
@@ -48,6 +40,10 @@
 import com.arangodb.velocystream.Request;
 import com.arangodb.velocystream.Response;
 
+import java.io.IOException;
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/ArangoDatabaseAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java
similarity index 98%
rename from src/main/java/com/arangodb/internal/ArangoDatabaseAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java
index 29fceee..bf9b2bc 100644
--- a/src/main/java/com/arangodb/internal/ArangoDatabaseAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java
@@ -18,24 +18,14 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-
-import com.arangodb.ArangoCollectionAsync;
-import com.arangodb.ArangoCursorAsync;
 import com.arangodb.ArangoDBException;
-import com.arangodb.ArangoDatabaseAsync;
-import com.arangodb.ArangoGraphAsync;
-import com.arangodb.ArangoRouteAsync;
-import com.arangodb.ArangoSearchAsync;
-import com.arangodb.ArangoViewAsync;
+import com.arangodb.async.*;
 import com.arangodb.entity.*;
 import com.arangodb.entity.arangosearch.AnalyzerEntity;
+import com.arangodb.internal.ArangoCursorExecute;
+import com.arangodb.internal.InternalArangoDatabase;
 import com.arangodb.internal.net.HostHandle;
 import com.arangodb.internal.util.DocumentUtil;
 import com.arangodb.model.*;
@@ -44,6 +34,12 @@
 import com.arangodb.velocypack.Type;
 import com.arangodb.velocystream.Request;
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+
 /**
  * @author Mark Vollmary
  * @author Michele Rastelli
diff --git a/src/main/java/com/arangodb/internal/ArangoEdgeCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java
similarity index 95%
rename from src/main/java/com/arangodb/internal/ArangoEdgeCollectionAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java
index 1e5d2b8..a54bd4a 100644
--- a/src/main/java/com/arangodb/internal/ArangoEdgeCollectionAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java
@@ -18,15 +18,16 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoEdgeCollectionAsync;
+import com.arangodb.async.ArangoEdgeCollectionAsync;
 import com.arangodb.entity.EdgeEntity;
 import com.arangodb.entity.EdgeUpdateEntity;
+import com.arangodb.internal.InternalArangoEdgeCollection;
 import com.arangodb.model.*;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/ArangoExecutorAsync.java b/src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java
similarity index 88%
rename from src/main/java/com/arangodb/internal/ArangoExecutorAsync.java
rename to src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java
index 65df755..b37810c 100644
--- a/src/main/java/com/arangodb/internal/ArangoExecutorAsync.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java
@@ -18,16 +18,20 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
+import com.arangodb.async.internal.velocystream.VstCommunicationAsync;
+import com.arangodb.internal.ArangoExecutor;
+import com.arangodb.internal.DocumentCache;
 import com.arangodb.internal.net.HostHandle;
 import com.arangodb.internal.util.ArangoSerializationFactory;
-import com.arangodb.internal.velocystream.VstCommunicationAsync;
 import com.arangodb.velocystream.Request;
 
 import java.io.IOException;
 import java.lang.reflect.Type;
-import java.util.concurrent.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 /**
  * @author Mark Vollmary
diff --git a/src/main/java/com/arangodb/internal/ArangoGraphAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java
similarity index 93%
rename from src/main/java/com/arangodb/internal/ArangoGraphAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java
index 3cec770..aa87f83 100644
--- a/src/main/java/com/arangodb/internal/ArangoGraphAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java
@@ -18,18 +18,19 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.Collection;
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoEdgeCollectionAsync;
-import com.arangodb.ArangoGraphAsync;
-import com.arangodb.ArangoVertexCollectionAsync;
+import com.arangodb.async.ArangoEdgeCollectionAsync;
+import com.arangodb.async.ArangoGraphAsync;
+import com.arangodb.async.ArangoVertexCollectionAsync;
 import com.arangodb.entity.EdgeDefinition;
 import com.arangodb.entity.GraphEntity;
+import com.arangodb.internal.InternalArangoGraph;
 import com.arangodb.model.GraphCreateOptions;
 
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/ArangoRouteAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java
similarity index 95%
rename from src/main/java/com/arangodb/internal/ArangoRouteAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java
index a65e5ac..3e7b8ea 100644
--- a/src/main/java/com/arangodb/internal/ArangoRouteAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java
@@ -18,17 +18,18 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoRouteAsync;
+import com.arangodb.async.ArangoRouteAsync;
 import com.arangodb.internal.ArangoExecutor.ResponseDeserializer;
+import com.arangodb.internal.InternalArangoRoute;
 import com.arangodb.velocypack.exception.VPackException;
 import com.arangodb.velocystream.RequestType;
 import com.arangodb.velocystream.Response;
 
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/ArangoSearchAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java
similarity index 95%
rename from src/main/java/com/arangodb/internal/ArangoSearchAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java
index bdc7716..59a3b9d 100644
--- a/src/main/java/com/arangodb/internal/ArangoSearchAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java
@@ -18,16 +18,17 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoSearchAsync;
+import com.arangodb.async.ArangoSearchAsync;
 import com.arangodb.entity.ViewEntity;
 import com.arangodb.entity.arangosearch.ArangoSearchPropertiesEntity;
+import com.arangodb.internal.InternalArangoSearch;
 import com.arangodb.model.arangosearch.ArangoSearchCreateOptions;
 import com.arangodb.model.arangosearch.ArangoSearchPropertiesOptions;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/ArangoVertexCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java
similarity index 95%
rename from src/main/java/com/arangodb/internal/ArangoVertexCollectionAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java
index ca26a79..3a13e54 100644
--- a/src/main/java/com/arangodb/internal/ArangoVertexCollectionAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java
@@ -18,15 +18,16 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoVertexCollectionAsync;
+import com.arangodb.async.ArangoVertexCollectionAsync;
 import com.arangodb.entity.VertexEntity;
 import com.arangodb.entity.VertexUpdateEntity;
+import com.arangodb.internal.InternalArangoVertexCollection;
 import com.arangodb.model.*;
 
+import java.util.concurrent.CompletableFuture;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/ArangoViewAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java
similarity index 92%
rename from src/main/java/com/arangodb/internal/ArangoViewAsyncImpl.java
rename to src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java
index 78c36f1..1994746 100644
--- a/src/main/java/com/arangodb/internal/ArangoViewAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java
@@ -18,12 +18,13 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal;
+package com.arangodb.async.internal;
 
-import java.util.concurrent.CompletableFuture;
-
-import com.arangodb.ArangoViewAsync;
+import com.arangodb.async.ArangoViewAsync;
 import com.arangodb.entity.ViewEntity;
+import com.arangodb.internal.InternalArangoView;
+
+import java.util.concurrent.CompletableFuture;
 
 /**
  * @author Mark Vollmary
diff --git a/src/main/java/com/arangodb/internal/velocystream/VstCommunicationAsync.java b/src/main/java/com/arangodb/async/internal/velocystream/VstCommunicationAsync.java
similarity index 98%
rename from src/main/java/com/arangodb/internal/velocystream/VstCommunicationAsync.java
rename to src/main/java/com/arangodb/async/internal/velocystream/VstCommunicationAsync.java
index 1fe7f82..2f86fa6 100644
--- a/src/main/java/com/arangodb/internal/velocystream/VstCommunicationAsync.java
+++ b/src/main/java/com/arangodb/async/internal/velocystream/VstCommunicationAsync.java
@@ -18,11 +18,12 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal.velocystream;
+package com.arangodb.async.internal.velocystream;
 
 import com.arangodb.ArangoDBException;
 import com.arangodb.entity.ErrorEntity;
 import com.arangodb.internal.net.HostHandler;
+import com.arangodb.internal.velocystream.VstCommunication;
 import com.arangodb.internal.velocystream.internal.AuthenticationRequest;
 import com.arangodb.internal.velocystream.internal.Message;
 import com.arangodb.util.ArangoSerialization;
diff --git a/src/main/java/com/arangodb/internal/velocystream/VstConnectionAsync.java b/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java
similarity index 98%
rename from src/main/java/com/arangodb/internal/velocystream/VstConnectionAsync.java
rename to src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java
index 3879a0c..40b793f 100644
--- a/src/main/java/com/arangodb/internal/velocystream/VstConnectionAsync.java
+++ b/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java
@@ -18,14 +18,7 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal.velocystream;
-
-import java.util.Collection;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.FutureTask;
-
-import javax.net.ssl.SSLContext;
+package com.arangodb.async.internal.velocystream;
 
 import com.arangodb.internal.net.HostDescription;
 import com.arangodb.internal.velocystream.internal.Chunk;
@@ -33,6 +26,12 @@
 import com.arangodb.internal.velocystream.internal.MessageStore;
 import com.arangodb.internal.velocystream.internal.VstConnection;
 
+import javax.net.ssl.SSLContext;
+import java.util.Collection;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.FutureTask;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/main/java/com/arangodb/internal/velocystream/VstConnectionFactoryAsync.java b/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionFactoryAsync.java
similarity index 96%
rename from src/main/java/com/arangodb/internal/velocystream/VstConnectionFactoryAsync.java
rename to src/main/java/com/arangodb/async/internal/velocystream/VstConnectionFactoryAsync.java
index 696669c..da5a349 100644
--- a/src/main/java/com/arangodb/internal/velocystream/VstConnectionFactoryAsync.java
+++ b/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionFactoryAsync.java
@@ -18,15 +18,15 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.internal.velocystream;
-
-import javax.net.ssl.SSLContext;
+package com.arangodb.async.internal.velocystream;
 
 import com.arangodb.internal.net.Connection;
 import com.arangodb.internal.net.ConnectionFactory;
 import com.arangodb.internal.net.HostDescription;
 import com.arangodb.internal.velocystream.internal.MessageStore;
 
+import javax.net.ssl.SSLContext;
+
 /**
  * @author Mark Vollmary
  *
diff --git a/src/test/java/com/arangodb/ArangoCollectionTest.java b/src/test/java/com/arangodb/async/ArangoCollectionTest.java
similarity index 99%
rename from src/test/java/com/arangodb/ArangoCollectionTest.java
rename to src/test/java/com/arangodb/async/ArangoCollectionTest.java
index 65ce226..dbec782 100644
--- a/src/test/java/com/arangodb/ArangoCollectionTest.java
+++ b/src/test/java/com/arangodb/async/ArangoCollectionTest.java
@@ -18,8 +18,9 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
 import com.arangodb.entity.*;
 import com.arangodb.model.*;
 import com.arangodb.model.DocumentImportOptions.OnDuplicate;
diff --git a/src/test/java/com/arangodb/ArangoDBTest.java b/src/test/java/com/arangodb/async/ArangoDBTest.java
similarity index 97%
rename from src/test/java/com/arangodb/ArangoDBTest.java
rename to src/test/java/com/arangodb/async/ArangoDBTest.java
index 103d36d..e7fd426 100644
--- a/src/test/java/com/arangodb/ArangoDBTest.java
+++ b/src/test/java/com/arangodb/async/ArangoDBTest.java
@@ -1,528 +1,529 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb;
-
-import com.arangodb.entity.*;
-import com.arangodb.model.LogOptions;
-import com.arangodb.model.LogOptions.SortOrder;
-import com.arangodb.model.UserCreateOptions;
-import com.arangodb.model.UserUpdateOptions;
-import com.arangodb.velocypack.exception.VPackException;
-import com.arangodb.velocystream.Request;
-import com.arangodb.velocystream.RequestType;
-import org.junit.Test;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-/**
- * @author Mark Vollmary
- * @author Michele Rastelli
- */
-public class ArangoDBTest {
-
-    private static final String ROOT = "root";
-    private static final String USER = "mit dem mund";
-    private static final String PW = "machts der hund";
-
-    @Test
-    public void getVersion() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getVersion()
-                .whenComplete((version, ex) -> {
-                    assertThat(version, is(notNullValue()));
-                    assertThat(version.getServer(), is(notNullValue()));
-                    assertThat(version.getVersion(), is(notNullValue()));
-                })
-                .get();
-    }
-
-    @Test(timeout = 2000)
-    public void nestedGetVersion() {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        for (int i = 0; i < 100; i++) {
-            try {
-                arangoDB.getVersion()
-                        .whenComplete((v1, ex1) -> {
-                            assertThat(v1, is(notNullValue()));
-                            assertThat(v1.getServer(), is(notNullValue()));
-                            assertThat(v1.getVersion(), is(notNullValue()));
-                            try {
-                                arangoDB.getVersion()
-                                        .whenComplete((v2, ex2) -> {
-                                            assertThat(v2, is(notNullValue()));
-                                            assertThat(v2.getServer(), is(notNullValue()));
-                                            assertThat(v2.getVersion(), is(notNullValue()));
-                                            try {
-                                                arangoDB.getVersion()
-                                                        .whenComplete((v3, ex3) -> {
-                                                            assertThat(v3, is(notNullValue()));
-                                                            assertThat(v3.getServer(), is(notNullValue()));
-                                                            assertThat(v3.getVersion(), is(notNullValue()));
-                                                        })
-                                                        .get();
-                                            } catch (InterruptedException | ExecutionException e) {
-                                                e.printStackTrace();
-                                                fail();
-                                            }
-                                        })
-                                        .get();
-                            } catch (InterruptedException | ExecutionException e) {
-                                e.printStackTrace();
-                                fail();
-                            }
-                        })
-                        .get();
-            } catch (InterruptedException | ExecutionException e) {
-                e.printStackTrace();
-                fail();
-            }
-        }
-    }
-
-    @Test
-    public void createDatabase() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.createDatabase(BaseTest.TEST_DB)
-                .whenComplete((result, ex) -> assertThat(result, is(true)))
-                .get();
-        arangoDB.db(BaseTest.TEST_DB).drop().get();
-    }
-
-    @Test
-    public void deleteDatabase() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final Boolean resultCreate = arangoDB.createDatabase(BaseTest.TEST_DB).get();
-        assertThat(resultCreate, is(true));
-        arangoDB.db(BaseTest.TEST_DB).drop()
-                .whenComplete((resultDelete, ex) -> assertThat(resultDelete, is(true)))
-                .get();
-    }
-
-    @Test
-    public void getDatabases() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            Collection<String> dbs = arangoDB.getDatabases().get();
-            assertThat(dbs, is(notNullValue()));
-            assertThat(dbs.size(), is(greaterThan(0)));
-            final int dbCount = dbs.size();
-            assertThat(dbs.iterator().next(), is("_system"));
-            arangoDB.createDatabase(BaseTest.TEST_DB).get();
-            dbs = arangoDB.getDatabases().get();
-            assertThat(dbs.size(), is(greaterThan(dbCount)));
-            assertThat(dbs, hasItem("_system"));
-            assertThat(dbs, hasItem(BaseTest.TEST_DB));
-        } finally {
-            arangoDB.db(BaseTest.TEST_DB).drop().get();
-        }
-    }
-
-    @Test
-    public void getAccessibleDatabases() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getAccessibleDatabases()
-                .whenComplete((dbs, ex) -> {
-                    assertThat(dbs, is(notNullValue()));
-                    assertThat(dbs.size(), greaterThan(0));
-                    assertThat(dbs, hasItem("_system"));
-                })
-                .get();
-    }
-
-    @Test
-    public void getAccessibleDatabasesFor() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getAccessibleDatabasesFor("root")
-                .whenComplete((dbs, ex) -> {
-                    assertThat(dbs, is(notNullValue()));
-                    assertThat(dbs, is(notNullValue()));
-                    assertThat(dbs.size(), greaterThan(0));
-                    assertThat(dbs, hasItem("_system"));
-                })
-                .get();
-    }
-
-    @Test
-    public void createUser() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            arangoDB.createUser(USER, PW, null)
-                    .whenComplete((result, ex) -> {
-                        assertThat(result, is(notNullValue()));
-                        assertThat(result.getUser(), is(USER));
-                    })
-                    .get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void deleteUser() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.createUser(USER, PW, null).get();
-        arangoDB.deleteUser(USER).get();
-    }
-
-    @Test
-    public void getUserRoot() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getUser(ROOT)
-                .whenComplete((user, ex) -> {
-                    assertThat(user, is(notNullValue()));
-                    assertThat(user.getUser(), is(ROOT));
-                })
-                .get();
-    }
-
-    @Test
-    public void getUser() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            arangoDB.createUser(USER, PW, null).get();
-            arangoDB.getUser(USER)
-                    .whenComplete((user, ex) -> assertThat(user.getUser(), is(USER)))
-                    .get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-
-    }
-
-    @Test
-    public void getUsersOnlyRoot() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getUsers()
-                .whenComplete((users, ex) -> {
-                    assertThat(users, is(notNullValue()));
-                    assertThat(users.size(), greaterThan(0));
-                })
-                .get();
-    }
-
-    @Test
-    public void getUsers() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            arangoDB.createUser(USER, PW, null).get();
-            arangoDB.getUsers()
-                    .whenComplete((users, ex) -> {
-                        assertThat(users, is(notNullValue()));
-                        assertThat(users.size(), is(2));
-                        for (final UserEntity user : users) {
-                            assertThat(user.getUser(), anyOf(is(ROOT), is(USER)));
-                        }
-                    })
-                    .get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void updateUserNoOptions() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            arangoDB.createUser(USER, PW, null).get();
-            arangoDB.updateUser(USER, null).get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void updateUser() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            final Map<String, Object> extra = new HashMap<>();
-            extra.put("hund", false);
-            arangoDB.createUser(USER, PW, new UserCreateOptions().extra(extra)).get();
-            extra.put("hund", true);
-            extra.put("mund", true);
-            {
-                arangoDB.updateUser(USER, new UserUpdateOptions().extra(extra))
-                        .whenComplete((user, ex) -> {
-                            assertThat(user, is(notNullValue()));
-                            assertThat(user.getExtra().size(), is(2));
-                            assertThat(user.getExtra().get("hund"), is(notNullValue()));
-                            assertThat(Boolean.valueOf(String.valueOf(user.getExtra().get("hund"))), is(true));
-                        })
-                        .get();
-            }
-            arangoDB.getUser(USER)
-                    .whenComplete((user2, ex) -> {
-                        assertThat(user2.getExtra().size(), is(2));
-                        assertThat(user2.getExtra().get("hund"), is(notNullValue()));
-                        assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("hund"))), is(true));
-                    })
-                    .get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void replaceUser() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            final Map<String, Object> extra = new HashMap<>();
-            extra.put("hund", false);
-            arangoDB.createUser(USER, PW, new UserCreateOptions().extra(extra)).get();
-            extra.remove("hund");
-            extra.put("mund", true);
-            {
-                arangoDB.replaceUser(USER, new UserUpdateOptions().extra(extra))
-                        .whenComplete((user, ex) -> {
-                            assertThat(user, is(notNullValue()));
-                            assertThat(user.getExtra().size(), is(1));
-                            assertThat(user.getExtra().get("mund"), is(notNullValue()));
-                            assertThat(Boolean.valueOf(String.valueOf(user.getExtra().get("mund"))), is(true));
-                        })
-                        .get();
-            }
-            {
-                arangoDB.getUser(USER)
-                        .whenComplete((user2, ex) -> {
-                            assertThat(user2.getExtra().size(), is(1));
-                            assertThat(user2.getExtra().get("mund"), is(notNullValue()));
-                            assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("mund"))), is(true));
-                        })
-                        .get();
-            }
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void updateUserDefaultDatabaseAccess() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            arangoDB.createUser(USER, PW).get();
-            arangoDB.grantDefaultDatabaseAccess(USER, Permissions.RW).get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void updateUserDefaultCollectionAccess() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        try {
-            arangoDB.createUser(USER, PW).get();
-            arangoDB.grantDefaultCollectionAccess(USER, Permissions.RW).get();
-        } finally {
-            arangoDB.deleteUser(USER).get();
-        }
-    }
-
-    @Test
-    public void authenticationFailPassword() throws InterruptedException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().password("no").build();
-        try {
-            arangoDB.getVersion().get();
-            fail();
-        } catch (final ExecutionException exception) {
-            assertThat(exception.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void authenticationFailUser() throws InterruptedException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().user("no").build();
-        try {
-            arangoDB.getVersion().get();
-            fail();
-        } catch (final ExecutionException exception) {
-            assertThat(exception.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void execute() throws VPackException, InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB
-                .execute(new Request("_system", RequestType.GET, "/_api/version"))
-                .whenComplete((response, ex) -> {
-                    assertThat(response.getBody(), is(notNullValue()));
-                    assertThat(response.getBody().get("version").isString(), is(true));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogs() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getLogs(null)
-                .whenComplete((logs, ex) -> {
-                    assertThat(logs, is(notNullValue()));
-                    assertThat(logs.getTotalAmount(), greaterThan(0L));
-                    assertThat((long) logs.getLid().size(), is(logs.getTotalAmount()));
-                    assertThat((long) logs.getLevel().size(), is(logs.getTotalAmount()));
-                    assertThat((long) logs.getTimestamp().size(), is(logs.getTotalAmount()));
-                    assertThat((long) logs.getText().size(), is(logs.getTotalAmount()));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsUpto() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogEntity logs = arangoDB.getLogs(null).get();
-        arangoDB.getLogs(new LogOptions().upto(LogLevel.WARNING))
-                .whenComplete((logsUpto, ex) -> {
-                    assertThat(logsUpto, is(notNullValue()));
-                    assertThat(logs.getTotalAmount() >= logsUpto.getTotalAmount(), is(true));
-                    assertThat(logsUpto.getLevel(), not(contains(LogLevel.INFO)));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsLevel() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogEntity logs = arangoDB.getLogs(null).get();
-        arangoDB.getLogs(new LogOptions().level(LogLevel.INFO))
-                .whenComplete((logsInfo, ex) -> {
-                    assertThat(logsInfo, is(notNullValue()));
-                    assertThat(logs.getTotalAmount() >= logsInfo.getTotalAmount(), is(true));
-                    assertThat(logsInfo.getLevel(), everyItem(is(LogLevel.INFO)));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsStart() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogEntity logs = arangoDB.getLogs(null).get();
-        assertThat(logs.getLid(), not(empty()));
-        arangoDB.getLogs(new LogOptions().start(logs.getLid().get(0) + 1))
-                .whenComplete((logsStart, ex) -> {
-                    assertThat(logsStart, is(notNullValue()));
-                    assertThat(logsStart.getLid(), not(contains(logs.getLid().get(0))));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsSize() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogEntity logs = arangoDB.getLogs(null).get();
-        assertThat(logs.getLid().size(), greaterThan(0));
-        arangoDB.getLogs(new LogOptions().size(logs.getLid().size() - 1))
-                .whenComplete((logsSize, ex) -> {
-                    assertThat(logsSize, is(notNullValue()));
-                    assertThat(logsSize.getLid().size(), is(logs.getLid().size() - 1));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsOffset() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogEntity logs = arangoDB.getLogs(null).get();
-        assertThat(logs.getTotalAmount(), greaterThan(0L));
-        arangoDB.getLogs(new LogOptions().offset((int) (logs.getTotalAmount() - 1)))
-                .whenComplete((logsOffset, ex) -> {
-                    assertThat(logsOffset, is(notNullValue()));
-                    assertThat(logsOffset.getLid().size(), is(1));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsSearch() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogEntity logs = arangoDB.getLogs(null).get();
-        arangoDB.getLogs(new LogOptions().search(BaseTest.TEST_DB))
-                .whenComplete((logsSearch, ex) -> {
-                    assertThat(logsSearch, is(notNullValue()));
-                    assertThat(logs.getTotalAmount(), greaterThan(logsSearch.getTotalAmount()));
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsSortAsc() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getLogs(new LogOptions().sort(SortOrder.asc))
-                .whenComplete((logs, ex) -> {
-                    assertThat(logs, is(notNullValue()));
-                    long lastId = -1;
-                    for (final Long id : logs.getLid()) {
-                        assertThat(id, greaterThan(lastId));
-                        lastId = id;
-                    }
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogsSortDesc() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getLogs(new LogOptions().sort(SortOrder.desc))
-                .whenComplete((logs, ex) -> {
-                    assertThat(logs, is(notNullValue()));
-                    long lastId = Long.MAX_VALUE;
-                    for (final Long id : logs.getLid()) {
-                        assertThat(lastId, greaterThan(id));
-                        lastId = id;
-                    }
-                })
-                .get();
-    }
-
-    @Test
-    public void getLogLevel() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        arangoDB.getLogLevel()
-                .whenComplete((logLevel, ex) -> {
-                    assertThat(logLevel, is(notNullValue()));
-                    assertThat(logLevel.getAgency(), is(LogLevelEntity.LogLevel.INFO));
-                })
-                .get();
-    }
-
-    @Test
-    public void setLogLevel() throws InterruptedException, ExecutionException {
-        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-        final LogLevelEntity entity = new LogLevelEntity();
-        try {
-            entity.setAgency(LogLevelEntity.LogLevel.ERROR);
-            arangoDB.setLogLevel(entity)
-                    .whenComplete((logLevel, ex) -> {
-                        assertThat(logLevel, is(notNullValue()));
-                        assertThat(logLevel.getAgency(), is(LogLevelEntity.LogLevel.ERROR));
-                    })
-                    .get();
-        } finally {
-            entity.setAgency(LogLevelEntity.LogLevel.INFO);
-            arangoDB.setLogLevel(entity).get();
-        }
-    }
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async;
+
+import com.arangodb.ArangoDBException;
+import com.arangodb.entity.*;
+import com.arangodb.model.LogOptions;
+import com.arangodb.model.LogOptions.SortOrder;
+import com.arangodb.model.UserCreateOptions;
+import com.arangodb.model.UserUpdateOptions;
+import com.arangodb.velocypack.exception.VPackException;
+import com.arangodb.velocystream.Request;
+import com.arangodb.velocystream.RequestType;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Mark Vollmary
+ * @author Michele Rastelli
+ */
+public class ArangoDBTest {
+
+    private static final String ROOT = "root";
+    private static final String USER = "mit dem mund";
+    private static final String PW = "machts der hund";
+
+    @Test
+    public void getVersion() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getVersion()
+                .whenComplete((version, ex) -> {
+                    assertThat(version, is(notNullValue()));
+                    assertThat(version.getServer(), is(notNullValue()));
+                    assertThat(version.getVersion(), is(notNullValue()));
+                })
+                .get();
+    }
+
+    @Test(timeout = 2000)
+    public void nestedGetVersion() {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        for (int i = 0; i < 100; i++) {
+            try {
+                arangoDB.getVersion()
+                        .whenComplete((v1, ex1) -> {
+                            assertThat(v1, is(notNullValue()));
+                            assertThat(v1.getServer(), is(notNullValue()));
+                            assertThat(v1.getVersion(), is(notNullValue()));
+                            try {
+                                arangoDB.getVersion()
+                                        .whenComplete((v2, ex2) -> {
+                                            assertThat(v2, is(notNullValue()));
+                                            assertThat(v2.getServer(), is(notNullValue()));
+                                            assertThat(v2.getVersion(), is(notNullValue()));
+                                            try {
+                                                arangoDB.getVersion()
+                                                        .whenComplete((v3, ex3) -> {
+                                                            assertThat(v3, is(notNullValue()));
+                                                            assertThat(v3.getServer(), is(notNullValue()));
+                                                            assertThat(v3.getVersion(), is(notNullValue()));
+                                                        })
+                                                        .get();
+                                            } catch (InterruptedException | ExecutionException e) {
+                                                e.printStackTrace();
+                                                fail();
+                                            }
+                                        })
+                                        .get();
+                            } catch (InterruptedException | ExecutionException e) {
+                                e.printStackTrace();
+                                fail();
+                            }
+                        })
+                        .get();
+            } catch (InterruptedException | ExecutionException e) {
+                e.printStackTrace();
+                fail();
+            }
+        }
+    }
+
+    @Test
+    public void createDatabase() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.createDatabase(BaseTest.TEST_DB)
+                .whenComplete((result, ex) -> assertThat(result, is(true)))
+                .get();
+        arangoDB.db(BaseTest.TEST_DB).drop().get();
+    }
+
+    @Test
+    public void deleteDatabase() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final Boolean resultCreate = arangoDB.createDatabase(BaseTest.TEST_DB).get();
+        assertThat(resultCreate, is(true));
+        arangoDB.db(BaseTest.TEST_DB).drop()
+                .whenComplete((resultDelete, ex) -> assertThat(resultDelete, is(true)))
+                .get();
+    }
+
+    @Test
+    public void getDatabases() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            Collection<String> dbs = arangoDB.getDatabases().get();
+            assertThat(dbs, is(notNullValue()));
+            assertThat(dbs.size(), is(greaterThan(0)));
+            final int dbCount = dbs.size();
+            assertThat(dbs.iterator().next(), is("_system"));
+            arangoDB.createDatabase(BaseTest.TEST_DB).get();
+            dbs = arangoDB.getDatabases().get();
+            assertThat(dbs.size(), is(greaterThan(dbCount)));
+            assertThat(dbs, hasItem("_system"));
+            assertThat(dbs, hasItem(BaseTest.TEST_DB));
+        } finally {
+            arangoDB.db(BaseTest.TEST_DB).drop().get();
+        }
+    }
+
+    @Test
+    public void getAccessibleDatabases() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getAccessibleDatabases()
+                .whenComplete((dbs, ex) -> {
+                    assertThat(dbs, is(notNullValue()));
+                    assertThat(dbs.size(), greaterThan(0));
+                    assertThat(dbs, hasItem("_system"));
+                })
+                .get();
+    }
+
+    @Test
+    public void getAccessibleDatabasesFor() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getAccessibleDatabasesFor("root")
+                .whenComplete((dbs, ex) -> {
+                    assertThat(dbs, is(notNullValue()));
+                    assertThat(dbs, is(notNullValue()));
+                    assertThat(dbs.size(), greaterThan(0));
+                    assertThat(dbs, hasItem("_system"));
+                })
+                .get();
+    }
+
+    @Test
+    public void createUser() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            arangoDB.createUser(USER, PW, null)
+                    .whenComplete((result, ex) -> {
+                        assertThat(result, is(notNullValue()));
+                        assertThat(result.getUser(), is(USER));
+                    })
+                    .get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void deleteUser() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.createUser(USER, PW, null).get();
+        arangoDB.deleteUser(USER).get();
+    }
+
+    @Test
+    public void getUserRoot() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getUser(ROOT)
+                .whenComplete((user, ex) -> {
+                    assertThat(user, is(notNullValue()));
+                    assertThat(user.getUser(), is(ROOT));
+                })
+                .get();
+    }
+
+    @Test
+    public void getUser() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            arangoDB.createUser(USER, PW, null).get();
+            arangoDB.getUser(USER)
+                    .whenComplete((user, ex) -> assertThat(user.getUser(), is(USER)))
+                    .get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+
+    }
+
+    @Test
+    public void getUsersOnlyRoot() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getUsers()
+                .whenComplete((users, ex) -> {
+                    assertThat(users, is(notNullValue()));
+                    assertThat(users.size(), greaterThan(0));
+                })
+                .get();
+    }
+
+    @Test
+    public void getUsers() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            arangoDB.createUser(USER, PW, null).get();
+            arangoDB.getUsers()
+                    .whenComplete((users, ex) -> {
+                        assertThat(users, is(notNullValue()));
+                        assertThat(users.size(), is(2));
+                        for (final UserEntity user : users) {
+                            assertThat(user.getUser(), anyOf(is(ROOT), is(USER)));
+                        }
+                    })
+                    .get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void updateUserNoOptions() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            arangoDB.createUser(USER, PW, null).get();
+            arangoDB.updateUser(USER, null).get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void updateUser() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            final Map<String, Object> extra = new HashMap<>();
+            extra.put("hund", false);
+            arangoDB.createUser(USER, PW, new UserCreateOptions().extra(extra)).get();
+            extra.put("hund", true);
+            extra.put("mund", true);
+            {
+                arangoDB.updateUser(USER, new UserUpdateOptions().extra(extra))
+                        .whenComplete((user, ex) -> {
+                            assertThat(user, is(notNullValue()));
+                            assertThat(user.getExtra().size(), is(2));
+                            assertThat(user.getExtra().get("hund"), is(notNullValue()));
+                            assertThat(Boolean.valueOf(String.valueOf(user.getExtra().get("hund"))), is(true));
+                        })
+                        .get();
+            }
+            arangoDB.getUser(USER)
+                    .whenComplete((user2, ex) -> {
+                        assertThat(user2.getExtra().size(), is(2));
+                        assertThat(user2.getExtra().get("hund"), is(notNullValue()));
+                        assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("hund"))), is(true));
+                    })
+                    .get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void replaceUser() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            final Map<String, Object> extra = new HashMap<>();
+            extra.put("hund", false);
+            arangoDB.createUser(USER, PW, new UserCreateOptions().extra(extra)).get();
+            extra.remove("hund");
+            extra.put("mund", true);
+            {
+                arangoDB.replaceUser(USER, new UserUpdateOptions().extra(extra))
+                        .whenComplete((user, ex) -> {
+                            assertThat(user, is(notNullValue()));
+                            assertThat(user.getExtra().size(), is(1));
+                            assertThat(user.getExtra().get("mund"), is(notNullValue()));
+                            assertThat(Boolean.valueOf(String.valueOf(user.getExtra().get("mund"))), is(true));
+                        })
+                        .get();
+            }
+            {
+                arangoDB.getUser(USER)
+                        .whenComplete((user2, ex) -> {
+                            assertThat(user2.getExtra().size(), is(1));
+                            assertThat(user2.getExtra().get("mund"), is(notNullValue()));
+                            assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("mund"))), is(true));
+                        })
+                        .get();
+            }
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void updateUserDefaultDatabaseAccess() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            arangoDB.createUser(USER, PW).get();
+            arangoDB.grantDefaultDatabaseAccess(USER, Permissions.RW).get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void updateUserDefaultCollectionAccess() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        try {
+            arangoDB.createUser(USER, PW).get();
+            arangoDB.grantDefaultCollectionAccess(USER, Permissions.RW).get();
+        } finally {
+            arangoDB.deleteUser(USER).get();
+        }
+    }
+
+    @Test
+    public void authenticationFailPassword() throws InterruptedException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().password("no").build();
+        try {
+            arangoDB.getVersion().get();
+            fail();
+        } catch (final ExecutionException exception) {
+            assertThat(exception.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void authenticationFailUser() throws InterruptedException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().user("no").build();
+        try {
+            arangoDB.getVersion().get();
+            fail();
+        } catch (final ExecutionException exception) {
+            assertThat(exception.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void execute() throws VPackException, InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB
+                .execute(new Request("_system", RequestType.GET, "/_api/version"))
+                .whenComplete((response, ex) -> {
+                    assertThat(response.getBody(), is(notNullValue()));
+                    assertThat(response.getBody().get("version").isString(), is(true));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogs() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getLogs(null)
+                .whenComplete((logs, ex) -> {
+                    assertThat(logs, is(notNullValue()));
+                    assertThat(logs.getTotalAmount(), greaterThan(0L));
+                    assertThat((long) logs.getLid().size(), is(logs.getTotalAmount()));
+                    assertThat((long) logs.getLevel().size(), is(logs.getTotalAmount()));
+                    assertThat((long) logs.getTimestamp().size(), is(logs.getTotalAmount()));
+                    assertThat((long) logs.getText().size(), is(logs.getTotalAmount()));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsUpto() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogEntity logs = arangoDB.getLogs(null).get();
+        arangoDB.getLogs(new LogOptions().upto(LogLevel.WARNING))
+                .whenComplete((logsUpto, ex) -> {
+                    assertThat(logsUpto, is(notNullValue()));
+                    assertThat(logs.getTotalAmount() >= logsUpto.getTotalAmount(), is(true));
+                    assertThat(logsUpto.getLevel(), not(contains(LogLevel.INFO)));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsLevel() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogEntity logs = arangoDB.getLogs(null).get();
+        arangoDB.getLogs(new LogOptions().level(LogLevel.INFO))
+                .whenComplete((logsInfo, ex) -> {
+                    assertThat(logsInfo, is(notNullValue()));
+                    assertThat(logs.getTotalAmount() >= logsInfo.getTotalAmount(), is(true));
+                    assertThat(logsInfo.getLevel(), everyItem(is(LogLevel.INFO)));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsStart() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogEntity logs = arangoDB.getLogs(null).get();
+        assertThat(logs.getLid(), not(empty()));
+        arangoDB.getLogs(new LogOptions().start(logs.getLid().get(0) + 1))
+                .whenComplete((logsStart, ex) -> {
+                    assertThat(logsStart, is(notNullValue()));
+                    assertThat(logsStart.getLid(), not(contains(logs.getLid().get(0))));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsSize() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogEntity logs = arangoDB.getLogs(null).get();
+        assertThat(logs.getLid().size(), greaterThan(0));
+        arangoDB.getLogs(new LogOptions().size(logs.getLid().size() - 1))
+                .whenComplete((logsSize, ex) -> {
+                    assertThat(logsSize, is(notNullValue()));
+                    assertThat(logsSize.getLid().size(), is(logs.getLid().size() - 1));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsOffset() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogEntity logs = arangoDB.getLogs(null).get();
+        assertThat(logs.getTotalAmount(), greaterThan(0L));
+        arangoDB.getLogs(new LogOptions().offset((int) (logs.getTotalAmount() - 1)))
+                .whenComplete((logsOffset, ex) -> {
+                    assertThat(logsOffset, is(notNullValue()));
+                    assertThat(logsOffset.getLid().size(), is(1));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsSearch() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogEntity logs = arangoDB.getLogs(null).get();
+        arangoDB.getLogs(new LogOptions().search(BaseTest.TEST_DB))
+                .whenComplete((logsSearch, ex) -> {
+                    assertThat(logsSearch, is(notNullValue()));
+                    assertThat(logs.getTotalAmount(), greaterThan(logsSearch.getTotalAmount()));
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsSortAsc() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getLogs(new LogOptions().sort(SortOrder.asc))
+                .whenComplete((logs, ex) -> {
+                    assertThat(logs, is(notNullValue()));
+                    long lastId = -1;
+                    for (final Long id : logs.getLid()) {
+                        assertThat(id, greaterThan(lastId));
+                        lastId = id;
+                    }
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogsSortDesc() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getLogs(new LogOptions().sort(SortOrder.desc))
+                .whenComplete((logs, ex) -> {
+                    assertThat(logs, is(notNullValue()));
+                    long lastId = Long.MAX_VALUE;
+                    for (final Long id : logs.getLid()) {
+                        assertThat(lastId, greaterThan(id));
+                        lastId = id;
+                    }
+                })
+                .get();
+    }
+
+    @Test
+    public void getLogLevel() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        arangoDB.getLogLevel()
+                .whenComplete((logLevel, ex) -> {
+                    assertThat(logLevel, is(notNullValue()));
+                    assertThat(logLevel.getAgency(), is(LogLevelEntity.LogLevel.INFO));
+                })
+                .get();
+    }
+
+    @Test
+    public void setLogLevel() throws InterruptedException, ExecutionException {
+        final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+        final LogLevelEntity entity = new LogLevelEntity();
+        try {
+            entity.setAgency(LogLevelEntity.LogLevel.ERROR);
+            arangoDB.setLogLevel(entity)
+                    .whenComplete((logLevel, ex) -> {
+                        assertThat(logLevel, is(notNullValue()));
+                        assertThat(logLevel.getAgency(), is(LogLevelEntity.LogLevel.ERROR));
+                    })
+                    .get();
+        } finally {
+            entity.setAgency(LogLevelEntity.LogLevel.INFO);
+            arangoDB.setLogLevel(entity).get();
+        }
+    }
+}
diff --git a/src/test/java/com/arangodb/ArangoDatabaseTest.java b/src/test/java/com/arangodb/async/ArangoDatabaseTest.java
similarity index 99%
rename from src/test/java/com/arangodb/ArangoDatabaseTest.java
rename to src/test/java/com/arangodb/async/ArangoDatabaseTest.java
index a44591f..1bdfe66 100644
--- a/src/test/java/com/arangodb/ArangoDatabaseTest.java
+++ b/src/test/java/com/arangodb/async/ArangoDatabaseTest.java
@@ -18,8 +18,9 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
 import com.arangodb.entity.AqlExecutionExplainEntity.ExecutionPlan;
 import com.arangodb.entity.*;
 import com.arangodb.entity.AqlParseEntity.AstNode;
diff --git a/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java b/src/test/java/com/arangodb/async/ArangoEdgeCollectionTest.java
similarity index 96%
rename from src/test/java/com/arangodb/ArangoEdgeCollectionTest.java
rename to src/test/java/com/arangodb/async/ArangoEdgeCollectionTest.java
index f7f2796..e692246 100644
--- a/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java
+++ b/src/test/java/com/arangodb/async/ArangoEdgeCollectionTest.java
@@ -1,390 +1,384 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb;
-
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.concurrent.ExecutionException;
-
-import com.arangodb.model.*;
-import org.junit.After;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.arangodb.entity.BaseDocument;
-import com.arangodb.entity.BaseEdgeDocument;
-import com.arangodb.entity.CollectionType;
-import com.arangodb.entity.EdgeDefinition;
-import com.arangodb.entity.EdgeEntity;
-import com.arangodb.entity.EdgeUpdateEntity;
-import com.arangodb.entity.VertexEntity;
-
-/**
- * @author Mark Vollmary
- */
-public class ArangoEdgeCollectionTest extends BaseTest {
-
-    private static final String GRAPH_NAME = "db_collection_test";
-    private static final String EDGE_COLLECTION_NAME = "db_edge_collection_test";
-    private static final String VERTEX_COLLECTION_NAME = "db_vertex_collection_test";
-
-    @BeforeClass
-    public static void setup() throws InterruptedException, ExecutionException {
-        if (!db.collection(VERTEX_COLLECTION_NAME).exists().get()) {
-            db.createCollection(VERTEX_COLLECTION_NAME, null).get();
-        }
-        if (!db.collection(EDGE_COLLECTION_NAME).exists().get()) {
-            db.createCollection(EDGE_COLLECTION_NAME, new CollectionCreateOptions().type(CollectionType.EDGES)).get();
-        }
-        final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<>();
-        edgeDefinitions.add(new EdgeDefinition().collection(EDGE_COLLECTION_NAME).from(VERTEX_COLLECTION_NAME)
-                .to(VERTEX_COLLECTION_NAME));
-        db.createGraph(GRAPH_NAME, edgeDefinitions, null).get();
-    }
-
-    @After
-    public void teardown() throws InterruptedException, ExecutionException {
-        for (final String collection : new String[]{VERTEX_COLLECTION_NAME, EDGE_COLLECTION_NAME}) {
-            db.collection(collection).truncate().get();
-        }
-    }
-
-    private BaseEdgeDocument createEdgeValue() throws InterruptedException, ExecutionException {
-        final VertexEntity v1 = db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        final VertexEntity v2 = db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-
-        final BaseEdgeDocument value = new BaseEdgeDocument();
-        value.setFrom(v1.getId());
-        value.setTo(v2.getId());
-        return value;
-    }
-
-    @Test
-    public void insertEdge() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = createEdgeValue();
-        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
-        assertThat(edge, is(notNullValue()));
-        final BaseEdgeDocument document = db.collection(EDGE_COLLECTION_NAME)
-                .getDocument(edge.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(edge.getKey()));
-    }
-
-    @Test
-    public void getEdge() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = createEdgeValue();
-        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
-        final BaseDocument document = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(edge.getKey(), BaseDocument.class, null).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(edge.getKey()));
-    }
-
-    @Test
-    public void getEdgeIfMatch() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = createEdgeValue();
-        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch(edge.getRev());
-        final BaseDocument document = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(edge.getKey(), BaseDocument.class, options).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(edge.getKey()));
-    }
-
-    @Test
-    public void getEdgeIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = createEdgeValue();
-        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch("no");
-        try {
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                    .getEdge(edge.getKey(), BaseEdgeDocument.class, options).get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void getEdgeIfNoneMatch() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = createEdgeValue();
-        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch("no");
-        final BaseDocument document = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(edge.getKey(), BaseDocument.class, options).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(edge.getKey()));
-    }
-
-    @Test
-    public void getEdgeIfNoneMatchFail() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = createEdgeValue();
-        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch(edge.getRev());
-        try {
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                    .getEdge(edge.getKey(), BaseEdgeDocument.class, options).get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void replaceEdge() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.getProperties().clear();
-        doc.addAttribute("b", "test");
-        final EdgeUpdateEntity replaceResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .replaceEdge(createResult.getKey(), doc, null).get();
-        assertThat(replaceResult, is(notNullValue()));
-        assertThat(replaceResult.getId(), is(createResult.getId()));
-        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
-        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-    }
-
-    @Test
-    public void replaceEdgeIfMatch() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.getProperties().clear();
-        doc.addAttribute("b", "test");
-        final EdgeReplaceOptions options = new EdgeReplaceOptions().ifMatch(createResult.getRev());
-        final EdgeUpdateEntity replaceResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .replaceEdge(createResult.getKey(), doc, options).get();
-        assertThat(replaceResult, is(notNullValue()));
-        assertThat(replaceResult.getId(), is(createResult.getId()));
-        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
-        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-    }
-
-    @Test
-    public void replaceEdgeIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.getProperties().clear();
-        doc.addAttribute("b", "test");
-        try {
-            final EdgeReplaceOptions options = new EdgeReplaceOptions().ifMatch("no");
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).replaceEdge(createResult.getKey(), doc, options)
-                    .get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void updateEdge() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        doc.addAttribute("c", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.updateAttribute("a", "test1");
-        doc.addAttribute("b", "test");
-        doc.updateAttribute("c", null);
-        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .updateEdge(createResult.getKey(), doc, null).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getAttribute("a"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-        assertThat(readResult.getRevision(), is(updateResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), hasItem("c"));
-    }
-
-    @Test
-    public void updateEdgeIfMatch() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        doc.addAttribute("c", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.updateAttribute("a", "test1");
-        doc.addAttribute("b", "test");
-        doc.updateAttribute("c", null);
-        final EdgeUpdateOptions options = new EdgeUpdateOptions().ifMatch(createResult.getRev());
-        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .updateEdge(createResult.getKey(), doc, options).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getAttribute("a"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-        assertThat(readResult.getRevision(), is(updateResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), hasItem("c"));
-    }
-
-    @Test
-    public void updateEdgeIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        doc.addAttribute("c", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.updateAttribute("a", "test1");
-        doc.addAttribute("b", "test");
-        doc.updateAttribute("c", null);
-        try {
-            final EdgeUpdateOptions options = new EdgeUpdateOptions().ifMatch("no");
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).updateEdge(createResult.getKey(), doc, options)
-                    .get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void updateEdgeKeepNullTrue() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.updateAttribute("a", null);
-        final EdgeUpdateOptions options = new EdgeUpdateOptions().keepNull(true);
-        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .updateEdge(createResult.getKey(), doc, options).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getProperties().keySet().size(), is(1));
-        assertThat(readResult.getProperties().keySet(), hasItem("a"));
-    }
-
-    @Test
-    public void updateEdgeKeepNullFalse() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        doc.addAttribute("a", "test");
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        doc.updateAttribute("a", null);
-        final EdgeUpdateOptions options = new EdgeUpdateOptions().keepNull(false);
-        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .updateEdge(createResult.getKey(), doc, options).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getId(), is(createResult.getId()));
-        assertThat(readResult.getRevision(), is(notNullValue()));
-        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
-    }
-
-    @Test
-    public void deleteEdge() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), null).get();
-        try {
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                    .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void deleteEdgeIfMatch() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        final EdgeDeleteOptions options = new EdgeDeleteOptions().ifMatch(createResult.getRev());
-        db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), options).get();
-        try {
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
-                    .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void deleteEdgeIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument doc = createEdgeValue();
-        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
-                .get();
-        final EdgeDeleteOptions options = new EdgeDeleteOptions().ifMatch("no");
-        try {
-            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), options).get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async;
+
+import com.arangodb.ArangoDBException;
+import com.arangodb.entity.*;
+import com.arangodb.model.*;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Mark Vollmary
+ */
+public class ArangoEdgeCollectionTest extends BaseTest {
+
+    private static final String GRAPH_NAME = "db_collection_test";
+    private static final String EDGE_COLLECTION_NAME = "db_edge_collection_test";
+    private static final String VERTEX_COLLECTION_NAME = "db_vertex_collection_test";
+
+    @BeforeClass
+    public static void setup() throws InterruptedException, ExecutionException {
+        if (!db.collection(VERTEX_COLLECTION_NAME).exists().get()) {
+            db.createCollection(VERTEX_COLLECTION_NAME, null).get();
+        }
+        if (!db.collection(EDGE_COLLECTION_NAME).exists().get()) {
+            db.createCollection(EDGE_COLLECTION_NAME, new CollectionCreateOptions().type(CollectionType.EDGES)).get();
+        }
+        final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<>();
+        edgeDefinitions.add(new EdgeDefinition().collection(EDGE_COLLECTION_NAME).from(VERTEX_COLLECTION_NAME)
+                .to(VERTEX_COLLECTION_NAME));
+        db.createGraph(GRAPH_NAME, edgeDefinitions, null).get();
+    }
+
+    @After
+    public void teardown() throws InterruptedException, ExecutionException {
+        for (final String collection : new String[]{VERTEX_COLLECTION_NAME, EDGE_COLLECTION_NAME}) {
+            db.collection(collection).truncate().get();
+        }
+    }
+
+    private BaseEdgeDocument createEdgeValue() throws InterruptedException, ExecutionException {
+        final VertexEntity v1 = db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        final VertexEntity v2 = db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+
+        final BaseEdgeDocument value = new BaseEdgeDocument();
+        value.setFrom(v1.getId());
+        value.setTo(v2.getId());
+        return value;
+    }
+
+    @Test
+    public void insertEdge() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = createEdgeValue();
+        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
+        assertThat(edge, is(notNullValue()));
+        final BaseEdgeDocument document = db.collection(EDGE_COLLECTION_NAME)
+                .getDocument(edge.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(edge.getKey()));
+    }
+
+    @Test
+    public void getEdge() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = createEdgeValue();
+        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
+        final BaseDocument document = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(edge.getKey(), BaseDocument.class, null).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(edge.getKey()));
+    }
+
+    @Test
+    public void getEdgeIfMatch() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = createEdgeValue();
+        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch(edge.getRev());
+        final BaseDocument document = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(edge.getKey(), BaseDocument.class, options).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(edge.getKey()));
+    }
+
+    @Test
+    public void getEdgeIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = createEdgeValue();
+        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch("no");
+        try {
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                    .getEdge(edge.getKey(), BaseEdgeDocument.class, options).get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void getEdgeIfNoneMatch() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = createEdgeValue();
+        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch("no");
+        final BaseDocument document = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(edge.getKey(), BaseDocument.class, options).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(edge.getKey()));
+    }
+
+    @Test
+    public void getEdgeIfNoneMatchFail() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = createEdgeValue();
+        final EdgeEntity edge = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(value, null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch(edge.getRev());
+        try {
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                    .getEdge(edge.getKey(), BaseEdgeDocument.class, options).get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void replaceEdge() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.getProperties().clear();
+        doc.addAttribute("b", "test");
+        final EdgeUpdateEntity replaceResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .replaceEdge(createResult.getKey(), doc, null).get();
+        assertThat(replaceResult, is(notNullValue()));
+        assertThat(replaceResult.getId(), is(createResult.getId()));
+        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
+        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+    }
+
+    @Test
+    public void replaceEdgeIfMatch() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.getProperties().clear();
+        doc.addAttribute("b", "test");
+        final EdgeReplaceOptions options = new EdgeReplaceOptions().ifMatch(createResult.getRev());
+        final EdgeUpdateEntity replaceResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .replaceEdge(createResult.getKey(), doc, options).get();
+        assertThat(replaceResult, is(notNullValue()));
+        assertThat(replaceResult.getId(), is(createResult.getId()));
+        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
+        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+    }
+
+    @Test
+    public void replaceEdgeIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.getProperties().clear();
+        doc.addAttribute("b", "test");
+        try {
+            final EdgeReplaceOptions options = new EdgeReplaceOptions().ifMatch("no");
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).replaceEdge(createResult.getKey(), doc, options)
+                    .get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void updateEdge() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        doc.addAttribute("c", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.updateAttribute("a", "test1");
+        doc.addAttribute("b", "test");
+        doc.updateAttribute("c", null);
+        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .updateEdge(createResult.getKey(), doc, null).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getAttribute("a"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+        assertThat(readResult.getRevision(), is(updateResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), hasItem("c"));
+    }
+
+    @Test
+    public void updateEdgeIfMatch() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        doc.addAttribute("c", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.updateAttribute("a", "test1");
+        doc.addAttribute("b", "test");
+        doc.updateAttribute("c", null);
+        final EdgeUpdateOptions options = new EdgeUpdateOptions().ifMatch(createResult.getRev());
+        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .updateEdge(createResult.getKey(), doc, options).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getAttribute("a"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+        assertThat(readResult.getRevision(), is(updateResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), hasItem("c"));
+    }
+
+    @Test
+    public void updateEdgeIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        doc.addAttribute("c", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.updateAttribute("a", "test1");
+        doc.addAttribute("b", "test");
+        doc.updateAttribute("c", null);
+        try {
+            final EdgeUpdateOptions options = new EdgeUpdateOptions().ifMatch("no");
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).updateEdge(createResult.getKey(), doc, options)
+                    .get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void updateEdgeKeepNullTrue() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.updateAttribute("a", null);
+        final EdgeUpdateOptions options = new EdgeUpdateOptions().keepNull(true);
+        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .updateEdge(createResult.getKey(), doc, options).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getProperties().keySet().size(), is(1));
+        assertThat(readResult.getProperties().keySet(), hasItem("a"));
+    }
+
+    @Test
+    public void updateEdgeKeepNullFalse() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        doc.addAttribute("a", "test");
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        doc.updateAttribute("a", null);
+        final EdgeUpdateOptions options = new EdgeUpdateOptions().keepNull(false);
+        final EdgeUpdateEntity updateResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .updateEdge(createResult.getKey(), doc, options).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseEdgeDocument readResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getId(), is(createResult.getId()));
+        assertThat(readResult.getRevision(), is(notNullValue()));
+        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
+    }
+
+    @Test
+    public void deleteEdge() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), null).get();
+        try {
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                    .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void deleteEdgeIfMatch() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        final EdgeDeleteOptions options = new EdgeDeleteOptions().ifMatch(createResult.getRev());
+        db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), options).get();
+        try {
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)
+                    .getEdge(createResult.getKey(), BaseEdgeDocument.class, null).get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void deleteEdgeIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument doc = createEdgeValue();
+        final EdgeEntity createResult = db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(doc, null)
+                .get();
+        final EdgeDeleteOptions options = new EdgeDeleteOptions().ifMatch("no");
+        try {
+            db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).deleteEdge(createResult.getKey(), options).get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+}
diff --git a/src/test/java/com/arangodb/ArangoGraphTest.java b/src/test/java/com/arangodb/async/ArangoGraphTest.java
similarity index 99%
rename from src/test/java/com/arangodb/ArangoGraphTest.java
rename to src/test/java/com/arangodb/async/ArangoGraphTest.java
index ff7e974..833fba4 100644
--- a/src/test/java/com/arangodb/ArangoGraphTest.java
+++ b/src/test/java/com/arangodb/async/ArangoGraphTest.java
@@ -18,7 +18,7 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
 import com.arangodb.entity.CollectionPropertiesEntity;
 import com.arangodb.entity.EdgeDefinition;
diff --git a/src/test/java/com/arangodb/ArangoRouteTest.java b/src/test/java/com/arangodb/async/ArangoRouteTest.java
similarity index 97%
rename from src/test/java/com/arangodb/ArangoRouteTest.java
rename to src/test/java/com/arangodb/async/ArangoRouteTest.java
index 60d94ab..f0c5f60 100644
--- a/src/test/java/com/arangodb/ArangoRouteTest.java
+++ b/src/test/java/com/arangodb/async/ArangoRouteTest.java
@@ -18,18 +18,18 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
+import com.arangodb.ArangoDBException;
+import com.arangodb.entity.BaseDocument;
+import com.arangodb.internal.ArangoRequestParam;
+import org.junit.Test;
 
 import java.util.concurrent.ExecutionException;
 
-import org.junit.Test;
-
-import com.arangodb.entity.BaseDocument;
-import com.arangodb.internal.ArangoRequestParam;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 /**
  * @author Mark Vollmary
diff --git a/src/test/java/com/arangodb/ArangoSearchTest.java b/src/test/java/com/arangodb/async/ArangoSearchTest.java
similarity index 99%
rename from src/test/java/com/arangodb/ArangoSearchTest.java
rename to src/test/java/com/arangodb/async/ArangoSearchTest.java
index 078d2b4..0a67ace 100644
--- a/src/test/java/com/arangodb/ArangoSearchTest.java
+++ b/src/test/java/com/arangodb/async/ArangoSearchTest.java
@@ -18,8 +18,9 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
 import com.arangodb.entity.ViewEntity;
 import com.arangodb.entity.ViewType;
 import com.arangodb.entity.arangosearch.*;
diff --git a/src/test/java/com/arangodb/ArangoSslTest.java b/src/test/java/com/arangodb/async/ArangoSslTest.java
similarity index 96%
rename from src/test/java/com/arangodb/ArangoSslTest.java
rename to src/test/java/com/arangodb/async/ArangoSslTest.java
index 75cf068..1cbc99c 100644
--- a/src/test/java/com/arangodb/ArangoSslTest.java
+++ b/src/test/java/com/arangodb/async/ArangoSslTest.java
@@ -1,94 +1,93 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.security.KeyStore;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLHandshakeException;
-import javax.net.ssl.TrustManagerFactory;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.arangodb.entity.ArangoDBVersion;
-
-/**
- * @author Mark Vollmary
- *
- */
-public class ArangoSslTest {
-
-	/*-
-	 * a SSL trust store
-	 * 
-	 * create the trust store for the self signed certificate:
-	 * keytool -import -alias "my arangodb server cert" -file UnitTests/server.pem -keystore example.truststore
-	 * 
-	 * Documentation:
-	 * https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/ssl/SSLSocketFactory.html
-	 */
-	private static final String SSL_TRUSTSTORE = "/example.truststore";
-	private static final String SSL_TRUSTSTORE_PASSWORD = "12345678";
-
-	@Test
-	@Ignore
-	public void connect() throws Exception {
-		final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
-		ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());
-
-		final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
-		kmf.init(ks, SSL_TRUSTSTORE_PASSWORD.toCharArray());
-
-		final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
-		tmf.init(ks);
-
-		final SSLContext sc = SSLContext.getInstance("TLS");
-		sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
-
-		final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
-				.loadProperties(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
-				.sslContext(sc).build();
-		final ArangoDBVersion version = arangoDB.getVersion().get();
-		assertThat(version, is(notNullValue()));
-	}
-
-	@Test
-	@Ignore
-	public void connectWithoutValidSslContext() throws Exception {
-		try {
-			final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
-					.loadProperties(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
-					.build();
-			arangoDB.getVersion().get();
-			fail("this should fail");
-		} catch (final ArangoDBException ex) {
-			assertThat(ex.getCause() instanceof SSLHandshakeException, is(true));
-		}
-	}
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async;
+
+import com.arangodb.ArangoDBException;
+import com.arangodb.entity.ArangoDBVersion;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.TrustManagerFactory;
+import java.security.KeyStore;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Mark Vollmary
+ *
+ */
+public class ArangoSslTest {
+
+	/*-
+	 * a SSL trust store
+	 * 
+	 * create the trust store for the self signed certificate:
+	 * keytool -import -alias "my arangodb server cert" -file UnitTests/server.pem -keystore example.truststore
+	 * 
+	 * Documentation:
+	 * https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/ssl/SSLSocketFactory.html
+	 */
+	private static final String SSL_TRUSTSTORE = "/example.truststore";
+	private static final String SSL_TRUSTSTORE_PASSWORD = "12345678";
+
+	@Test
+	@Ignore
+	public void connect() throws Exception {
+		final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+		ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());
+
+		final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+		kmf.init(ks, SSL_TRUSTSTORE_PASSWORD.toCharArray());
+
+		final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+		tmf.init(ks);
+
+		final SSLContext sc = SSLContext.getInstance("TLS");
+		sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+
+		final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
+				.loadProperties(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
+				.sslContext(sc).build();
+		final ArangoDBVersion version = arangoDB.getVersion().get();
+		assertThat(version, is(notNullValue()));
+	}
+
+	@Test
+	@Ignore
+	public void connectWithoutValidSslContext() throws Exception {
+		try {
+			final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
+					.loadProperties(ArangoSslTest.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
+					.build();
+			arangoDB.getVersion().get();
+			fail("this should fail");
+		} catch (final ArangoDBException ex) {
+			assertThat(ex.getCause() instanceof SSLHandshakeException, is(true));
+		}
+	}
+
+}
diff --git a/src/test/java/com/arangodb/ArangoVertexCollectionTest.java b/src/test/java/com/arangodb/async/ArangoVertexCollectionTest.java
similarity index 97%
rename from src/test/java/com/arangodb/ArangoVertexCollectionTest.java
rename to src/test/java/com/arangodb/async/ArangoVertexCollectionTest.java
index 00d9a87..72777a0 100644
--- a/src/test/java/com/arangodb/ArangoVertexCollectionTest.java
+++ b/src/test/java/com/arangodb/async/ArangoVertexCollectionTest.java
@@ -1,372 +1,372 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb;
-
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.util.Collection;
-import java.util.concurrent.ExecutionException;
-
-import com.arangodb.model.*;
-import org.junit.After;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.arangodb.entity.BaseDocument;
-import com.arangodb.entity.VertexEntity;
-import com.arangodb.entity.VertexUpdateEntity;
-
-/**
- * @author Mark Vollmary
- */
-public class ArangoVertexCollectionTest extends BaseTest {
-
-    private static final String GRAPH_NAME = "db_collection_test";
-    private static final String COLLECTION_NAME = "db_vertex_collection_test";
-
-    @BeforeClass
-    public static void setup() throws InterruptedException, ExecutionException {
-        if (!db.collection(COLLECTION_NAME).exists().get()) {
-            db.createCollection(COLLECTION_NAME, null).get();
-        }
-        final GraphCreateOptions options = new GraphCreateOptions().orphanCollections(COLLECTION_NAME);
-        db.createGraph(GRAPH_NAME, null, options).get();
-    }
-
-    @After
-    public void teardown() throws InterruptedException, ExecutionException {
-        db.collection(COLLECTION_NAME).truncate().get();
-    }
-
-    @Test
-    public void dropVertexCollection() throws InterruptedException, ExecutionException {
-        db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).drop().get();
-        final Collection<String> vertexCollections = db.graph(GRAPH_NAME).getVertexCollections().get();
-        assertThat(vertexCollections, not(hasItem(COLLECTION_NAME)));
-    }
-
-    @Test
-    public void insertVertex() throws InterruptedException, ExecutionException {
-        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        assertThat(vertex, is(notNullValue()));
-        final BaseDocument document = db.collection(COLLECTION_NAME)
-                .getDocument(vertex.getKey(), BaseDocument.class, null).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(vertex.getKey()));
-    }
-
-    @Test
-    public void getVertex() throws InterruptedException, ExecutionException {
-        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        final BaseDocument document = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(vertex.getKey(), BaseDocument.class, null).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(vertex.getKey()));
-    }
-
-    @Test
-    public void getVertexIfMatch() throws InterruptedException, ExecutionException {
-        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch(vertex.getRev());
-        final BaseDocument document = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(vertex.getKey(), BaseDocument.class, options).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(vertex.getKey()));
-    }
-
-    @Test
-    public void getVertexIfMatchFail() throws InterruptedException, ExecutionException {
-        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch("no");
-        try {
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                    .getVertex(vertex.getKey(), BaseDocument.class, options).get();
-            fail();
-        } catch (final ExecutionException e) {
-            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-        }
-    }
-
-    @Test
-    public void getVertexIfNoneMatch() throws InterruptedException, ExecutionException {
-        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch("no");
-        final BaseDocument document = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(vertex.getKey(), BaseDocument.class, options).get();
-        assertThat(document, is(notNullValue()));
-        assertThat(document.getKey(), is(vertex.getKey()));
-    }
-
-    @Test
-    public void getVertexIfNoneMatchFail() throws InterruptedException, ExecutionException {
-        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .insertVertex(new BaseDocument(), null).get();
-        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch(vertex.getRev());
-        try {
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                    .getVertex(vertex.getKey(), BaseDocument.class, options).get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-
-    @Test
-    public void replaceVertex() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.getProperties().clear();
-        doc.addAttribute("b", "test");
-        final VertexUpdateEntity replaceResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .replaceVertex(createResult.getKey(), doc, null).get();
-        assertThat(replaceResult, is(notNullValue()));
-        assertThat(replaceResult.getId(), is(createResult.getId()));
-        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
-        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-    }
-
-    @Test
-    public void replaceVertexIfMatch() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.getProperties().clear();
-        doc.addAttribute("b", "test");
-        final VertexReplaceOptions options = new VertexReplaceOptions().ifMatch(createResult.getRev());
-        final VertexUpdateEntity replaceResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .replaceVertex(createResult.getKey(), doc, options).get();
-        assertThat(replaceResult, is(notNullValue()));
-        assertThat(replaceResult.getId(), is(createResult.getId()));
-        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
-        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-    }
-
-    @Test
-    public void replaceVertexIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.getProperties().clear();
-        doc.addAttribute("b", "test");
-        try {
-            final VertexReplaceOptions options = new VertexReplaceOptions().ifMatch("no");
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).replaceVertex(createResult.getKey(), doc, options)
-                    .get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-
-    @Test
-    public void updateVertex() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        doc.addAttribute("c", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.updateAttribute("a", "test1");
-        doc.addAttribute("b", "test");
-        doc.updateAttribute("c", null);
-        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .updateVertex(createResult.getKey(), doc, null).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getAttribute("a"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-        assertThat(readResult.getRevision(), is(updateResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), hasItem("c"));
-    }
-
-    @Test
-    public void updateVertexIfMatch() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        doc.addAttribute("c", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.updateAttribute("a", "test1");
-        doc.addAttribute("b", "test");
-        doc.updateAttribute("c", null);
-        final VertexUpdateOptions options = new VertexUpdateOptions().ifMatch(createResult.getRev());
-        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .updateVertex(createResult.getKey(), doc, options).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getAttribute("a"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
-        assertThat(readResult.getAttribute("b"), is(notNullValue()));
-        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
-        assertThat(readResult.getRevision(), is(updateResult.getRev()));
-        assertThat(readResult.getProperties().keySet(), hasItem("c"));
-    }
-
-    @Test
-    public void updateVertexIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        doc.addAttribute("c", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.updateAttribute("a", "test1");
-        doc.addAttribute("b", "test");
-        doc.updateAttribute("c", null);
-        try {
-            final VertexUpdateOptions options = new VertexUpdateOptions().ifMatch("no");
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).updateVertex(createResult.getKey(), doc, options)
-                    .get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-
-    @Test
-    public void updateVertexKeepNullTrue() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.updateAttribute("a", null);
-        final VertexUpdateOptions options = new VertexUpdateOptions().keepNull(true);
-        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .updateVertex(createResult.getKey(), doc, options).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getProperties().keySet().size(), is(1));
-        assertThat(readResult.getProperties().keySet(), hasItem("a"));
-    }
-
-    @Test
-    public void updateVertexKeepNullFalse() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        doc.addAttribute("a", "test");
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        doc.updateAttribute("a", null);
-        final VertexUpdateOptions options = new VertexUpdateOptions().keepNull(false);
-        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .updateVertex(createResult.getKey(), doc, options).get();
-        assertThat(updateResult, is(notNullValue()));
-        assertThat(updateResult.getId(), is(createResult.getId()));
-        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
-        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
-
-        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-        assertThat(readResult.getKey(), is(createResult.getKey()));
-        assertThat(readResult.getId(), is(createResult.getId()));
-        assertThat(readResult.getRevision(), is(notNullValue()));
-        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
-    }
-
-    @Test
-    public void deleteVertex() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).deleteVertex(createResult.getKey(), null).get();
-        try {
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                    .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-
-    @Test
-    public void deleteVertexIfMatch() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        final VertexDeleteOptions options = new VertexDeleteOptions().ifMatch(createResult.getRev());
-        db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).deleteVertex(createResult.getKey(), options).get();
-        try {
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
-                    .getVertex(createResult.getKey(), BaseDocument.class, null).get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-
-    @Test
-    public void deleteVertexIfMatchFail() throws InterruptedException, ExecutionException {
-        final BaseDocument doc = new BaseDocument();
-        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
-                .get();
-        final VertexDeleteOptions options = new VertexDeleteOptions().ifMatch("no");
-        try {
-            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).deleteVertex(createResult.getKey(), options).get();
-            fail();
-        } catch (final ExecutionException e) {
-			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
-		}
-    }
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async;
+
+import com.arangodb.ArangoDBException;
+import com.arangodb.entity.BaseDocument;
+import com.arangodb.entity.VertexEntity;
+import com.arangodb.entity.VertexUpdateEntity;
+import com.arangodb.model.*;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Mark Vollmary
+ */
+public class ArangoVertexCollectionTest extends BaseTest {
+
+    private static final String GRAPH_NAME = "db_collection_test";
+    private static final String COLLECTION_NAME = "db_vertex_collection_test";
+
+    @BeforeClass
+    public static void setup() throws InterruptedException, ExecutionException {
+        if (!db.collection(COLLECTION_NAME).exists().get()) {
+            db.createCollection(COLLECTION_NAME, null).get();
+        }
+        final GraphCreateOptions options = new GraphCreateOptions().orphanCollections(COLLECTION_NAME);
+        db.createGraph(GRAPH_NAME, null, options).get();
+    }
+
+    @After
+    public void teardown() throws InterruptedException, ExecutionException {
+        db.collection(COLLECTION_NAME).truncate().get();
+    }
+
+    @Test
+    public void dropVertexCollection() throws InterruptedException, ExecutionException {
+        db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).drop().get();
+        final Collection<String> vertexCollections = db.graph(GRAPH_NAME).getVertexCollections().get();
+        assertThat(vertexCollections, not(hasItem(COLLECTION_NAME)));
+    }
+
+    @Test
+    public void insertVertex() throws InterruptedException, ExecutionException {
+        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        assertThat(vertex, is(notNullValue()));
+        final BaseDocument document = db.collection(COLLECTION_NAME)
+                .getDocument(vertex.getKey(), BaseDocument.class, null).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(vertex.getKey()));
+    }
+
+    @Test
+    public void getVertex() throws InterruptedException, ExecutionException {
+        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        final BaseDocument document = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(vertex.getKey(), BaseDocument.class, null).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(vertex.getKey()));
+    }
+
+    @Test
+    public void getVertexIfMatch() throws InterruptedException, ExecutionException {
+        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch(vertex.getRev());
+        final BaseDocument document = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(vertex.getKey(), BaseDocument.class, options).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(vertex.getKey()));
+    }
+
+    @Test
+    public void getVertexIfMatchFail() throws InterruptedException, ExecutionException {
+        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifMatch("no");
+        try {
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                    .getVertex(vertex.getKey(), BaseDocument.class, options).get();
+            fail();
+        } catch (final ExecutionException e) {
+            assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+        }
+    }
+
+    @Test
+    public void getVertexIfNoneMatch() throws InterruptedException, ExecutionException {
+        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch("no");
+        final BaseDocument document = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(vertex.getKey(), BaseDocument.class, options).get();
+        assertThat(document, is(notNullValue()));
+        assertThat(document.getKey(), is(vertex.getKey()));
+    }
+
+    @Test
+    public void getVertexIfNoneMatchFail() throws InterruptedException, ExecutionException {
+        final VertexEntity vertex = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .insertVertex(new BaseDocument(), null).get();
+        final GraphDocumentReadOptions options = new GraphDocumentReadOptions().ifNoneMatch(vertex.getRev());
+        try {
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                    .getVertex(vertex.getKey(), BaseDocument.class, options).get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+
+    @Test
+    public void replaceVertex() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.getProperties().clear();
+        doc.addAttribute("b", "test");
+        final VertexUpdateEntity replaceResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .replaceVertex(createResult.getKey(), doc, null).get();
+        assertThat(replaceResult, is(notNullValue()));
+        assertThat(replaceResult.getId(), is(createResult.getId()));
+        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
+        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+    }
+
+    @Test
+    public void replaceVertexIfMatch() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.getProperties().clear();
+        doc.addAttribute("b", "test");
+        final VertexReplaceOptions options = new VertexReplaceOptions().ifMatch(createResult.getRev());
+        final VertexUpdateEntity replaceResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .replaceVertex(createResult.getKey(), doc, options).get();
+        assertThat(replaceResult, is(notNullValue()));
+        assertThat(replaceResult.getId(), is(createResult.getId()));
+        assertThat(replaceResult.getRev(), is(not(replaceResult.getOldRev())));
+        assertThat(replaceResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getRevision(), is(replaceResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+    }
+
+    @Test
+    public void replaceVertexIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.getProperties().clear();
+        doc.addAttribute("b", "test");
+        try {
+            final VertexReplaceOptions options = new VertexReplaceOptions().ifMatch("no");
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).replaceVertex(createResult.getKey(), doc, options)
+                    .get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+
+    @Test
+    public void updateVertex() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        doc.addAttribute("c", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.updateAttribute("a", "test1");
+        doc.addAttribute("b", "test");
+        doc.updateAttribute("c", null);
+        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .updateVertex(createResult.getKey(), doc, null).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getAttribute("a"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+        assertThat(readResult.getRevision(), is(updateResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), hasItem("c"));
+    }
+
+    @Test
+    public void updateVertexIfMatch() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        doc.addAttribute("c", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.updateAttribute("a", "test1");
+        doc.addAttribute("b", "test");
+        doc.updateAttribute("c", null);
+        final VertexUpdateOptions options = new VertexUpdateOptions().ifMatch(createResult.getRev());
+        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .updateVertex(createResult.getKey(), doc, options).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getAttribute("a"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("a")), is("test1"));
+        assertThat(readResult.getAttribute("b"), is(notNullValue()));
+        assertThat(String.valueOf(readResult.getAttribute("b")), is("test"));
+        assertThat(readResult.getRevision(), is(updateResult.getRev()));
+        assertThat(readResult.getProperties().keySet(), hasItem("c"));
+    }
+
+    @Test
+    public void updateVertexIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        doc.addAttribute("c", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.updateAttribute("a", "test1");
+        doc.addAttribute("b", "test");
+        doc.updateAttribute("c", null);
+        try {
+            final VertexUpdateOptions options = new VertexUpdateOptions().ifMatch("no");
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).updateVertex(createResult.getKey(), doc, options)
+                    .get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+
+    @Test
+    public void updateVertexKeepNullTrue() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.updateAttribute("a", null);
+        final VertexUpdateOptions options = new VertexUpdateOptions().keepNull(true);
+        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .updateVertex(createResult.getKey(), doc, options).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getProperties().keySet().size(), is(1));
+        assertThat(readResult.getProperties().keySet(), hasItem("a"));
+    }
+
+    @Test
+    public void updateVertexKeepNullFalse() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        doc.addAttribute("a", "test");
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        doc.updateAttribute("a", null);
+        final VertexUpdateOptions options = new VertexUpdateOptions().keepNull(false);
+        final VertexUpdateEntity updateResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .updateVertex(createResult.getKey(), doc, options).get();
+        assertThat(updateResult, is(notNullValue()));
+        assertThat(updateResult.getId(), is(createResult.getId()));
+        assertThat(updateResult.getRev(), is(not(updateResult.getOldRev())));
+        assertThat(updateResult.getOldRev(), is(createResult.getRev()));
+
+        final BaseDocument readResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+        assertThat(readResult.getKey(), is(createResult.getKey()));
+        assertThat(readResult.getId(), is(createResult.getId()));
+        assertThat(readResult.getRevision(), is(notNullValue()));
+        assertThat(readResult.getProperties().keySet(), not(hasItem("a")));
+    }
+
+    @Test
+    public void deleteVertex() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).deleteVertex(createResult.getKey(), null).get();
+        try {
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                    .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+
+    @Test
+    public void deleteVertexIfMatch() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        final VertexDeleteOptions options = new VertexDeleteOptions().ifMatch(createResult.getRev());
+        db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).deleteVertex(createResult.getKey(), options).get();
+        try {
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)
+                    .getVertex(createResult.getKey(), BaseDocument.class, null).get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+
+    @Test
+    public void deleteVertexIfMatchFail() throws InterruptedException, ExecutionException {
+        final BaseDocument doc = new BaseDocument();
+        final VertexEntity createResult = db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).insertVertex(doc, null)
+                .get();
+        final VertexDeleteOptions options = new VertexDeleteOptions().ifMatch("no");
+        try {
+            db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME).deleteVertex(createResult.getKey(), options).get();
+            fail();
+        } catch (final ExecutionException e) {
+			assertThat(e.getCause(), instanceOf(ArangoDBException.class));
+		}
+    }
+}
diff --git a/src/test/java/com/arangodb/ArangoViewTest.java b/src/test/java/com/arangodb/async/ArangoViewTest.java
similarity index 99%
rename from src/test/java/com/arangodb/ArangoViewTest.java
rename to src/test/java/com/arangodb/async/ArangoViewTest.java
index 8f1a390..259b1b2 100644
--- a/src/test/java/com/arangodb/ArangoViewTest.java
+++ b/src/test/java/com/arangodb/async/ArangoViewTest.java
@@ -18,7 +18,7 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
 import com.arangodb.entity.ViewEntity;
 import com.arangodb.entity.ViewType;
diff --git a/src/test/java/com/arangodb/BaseTest.java b/src/test/java/com/arangodb/async/BaseTest.java
similarity index 99%
rename from src/test/java/com/arangodb/BaseTest.java
rename to src/test/java/com/arangodb/async/BaseTest.java
index 78638da..1da3f08 100644
--- a/src/test/java/com/arangodb/BaseTest.java
+++ b/src/test/java/com/arangodb/async/BaseTest.java
@@ -18,7 +18,7 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
 import com.arangodb.entity.ArangoDBEngine;
 import com.arangodb.entity.License;
diff --git a/src/test/java/com/arangodb/CommunicationTest.java b/src/test/java/com/arangodb/async/CommunicationTest.java
similarity index 94%
rename from src/test/java/com/arangodb/CommunicationTest.java
rename to src/test/java/com/arangodb/async/CommunicationTest.java
index bcfa2eb..392f89c 100644
--- a/src/test/java/com/arangodb/CommunicationTest.java
+++ b/src/test/java/com/arangodb/async/CommunicationTest.java
@@ -1,47 +1,47 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.concurrent.CompletableFuture;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @author Mark Vollmary
- *
- */
-public class CommunicationTest {
-
-	@Test
-	@Ignore
-	public void disconnect() {
-		final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
-		final CompletableFuture<ArangoCursorAsync<Object>> result = arangoDB.db().query("return sleep(1)", null, null,
-			null);
-		arangoDB.shutdown();
-		assertThat(result.isCompletedExceptionally(), is(true));
-	}
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.concurrent.CompletableFuture;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Mark Vollmary
+ *
+ */
+public class CommunicationTest {
+
+	@Test
+	@Ignore
+	public void disconnect() {
+		final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().build();
+		final CompletableFuture<ArangoCursorAsync<Object>> result = arangoDB.db().query("return sleep(1)", null, null,
+			null);
+		arangoDB.shutdown();
+		assertThat(result.isCompletedExceptionally(), is(true));
+	}
+
+}
diff --git a/src/test/java/com/arangodb/ConcurrencyTest.java b/src/test/java/com/arangodb/async/ConcurrencyTest.java
similarity index 96%
rename from src/test/java/com/arangodb/ConcurrencyTest.java
rename to src/test/java/com/arangodb/async/ConcurrencyTest.java
index f247fd9..07bcbe4 100644
--- a/src/test/java/com/arangodb/ConcurrencyTest.java
+++ b/src/test/java/com/arangodb/async/ConcurrencyTest.java
@@ -18,11 +18,11 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
 
+import com.arangodb.async.internal.ArangoExecutorAsync;
 import com.arangodb.entity.ArangoDBVersion;
-import com.arangodb.internal.ArangoExecutorAsync;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
diff --git a/src/test/java/com/arangodb/ConcurrentStreamTransactionsTest.java b/src/test/java/com/arangodb/async/ConcurrentStreamTransactionsTest.java
similarity index 98%
rename from src/test/java/com/arangodb/ConcurrentStreamTransactionsTest.java
rename to src/test/java/com/arangodb/async/ConcurrentStreamTransactionsTest.java
index 9f0f391..2210c41 100644
--- a/src/test/java/com/arangodb/ConcurrentStreamTransactionsTest.java
+++ b/src/test/java/com/arangodb/async/ConcurrentStreamTransactionsTest.java
@@ -18,8 +18,9 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
 import com.arangodb.entity.ArangoDBEngine;
 import com.arangodb.entity.BaseDocument;
 import com.arangodb.entity.StreamTransactionEntity;
diff --git a/src/test/java/com/arangodb/StreamTransactionTest.java b/src/test/java/com/arangodb/async/StreamTransactionTest.java
similarity index 99%
rename from src/test/java/com/arangodb/StreamTransactionTest.java
rename to src/test/java/com/arangodb/async/StreamTransactionTest.java
index 8601780..91e9b0e 100644
--- a/src/test/java/com/arangodb/StreamTransactionTest.java
+++ b/src/test/java/com/arangodb/async/StreamTransactionTest.java
@@ -18,8 +18,9 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb;
+package com.arangodb.async;
 
+import com.arangodb.ArangoDBException;
 import com.arangodb.entity.*;
 import com.arangodb.model.DocumentCreateOptions;
 import com.arangodb.model.DocumentReadOptions;
diff --git a/src/test/java/com/arangodb/debug/ConsolidationIntervalMsec.java b/src/test/java/com/arangodb/async/debug/ConsolidationIntervalMsec.java
similarity index 95%
rename from src/test/java/com/arangodb/debug/ConsolidationIntervalMsec.java
rename to src/test/java/com/arangodb/async/debug/ConsolidationIntervalMsec.java
index 041a430..5ec5027 100644
--- a/src/test/java/com/arangodb/debug/ConsolidationIntervalMsec.java
+++ b/src/test/java/com/arangodb/async/debug/ConsolidationIntervalMsec.java
@@ -18,10 +18,10 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.debug;
+package com.arangodb.async.debug;
 
-import com.arangodb.ArangoDBAsync;
-import com.arangodb.ArangoDatabaseAsync;
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.async.ArangoDatabaseAsync;
 import com.arangodb.entity.ViewEntity;
 import com.arangodb.entity.ViewType;
 import com.arangodb.entity.arangosearch.ArangoSearchPropertiesEntity;
diff --git a/src/test/java/com/arangodb/example/ExampleBase.java b/src/test/java/com/arangodb/async/example/ExampleBase.java
similarity index 89%
rename from src/test/java/com/arangodb/example/ExampleBase.java
rename to src/test/java/com/arangodb/async/example/ExampleBase.java
index e4462da..a62b194 100644
--- a/src/test/java/com/arangodb/example/ExampleBase.java
+++ b/src/test/java/com/arangodb/async/example/ExampleBase.java
@@ -1,62 +1,61 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example;
-
-import java.util.concurrent.ExecutionException;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-
-import com.arangodb.ArangoCollectionAsync;
-import com.arangodb.ArangoDBAsync;
-import com.arangodb.ArangoDatabaseAsync;
-
-/**
- * @author Mark Vollmary
- */
-public class ExampleBase {
-
-    private static final String DB_NAME = "json_example_db";
-    protected static final String COLLECTION_NAME = "json_example_collection";
-
-    private static ArangoDBAsync arangoDB;
-    protected static ArangoDatabaseAsync db;
-    protected static ArangoCollectionAsync collection;
-
-    @BeforeClass
-    public static void setUp() throws InterruptedException, ExecutionException {
-        arangoDB = new ArangoDBAsync.Builder().build();
-        if (arangoDB.db(DB_NAME).exists().get()) {
-            arangoDB.db(DB_NAME).drop().get();
-        }
-        arangoDB.createDatabase(DB_NAME).get();
-        db = arangoDB.db(DB_NAME);
-        db.createCollection(COLLECTION_NAME).get();
-        collection = db.collection(COLLECTION_NAME);
-    }
-
-    @AfterClass
-    public static void tearDown() throws InterruptedException, ExecutionException {
-        db.drop().get();
-        arangoDB.shutdown();
-    }
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example;
+
+import com.arangodb.async.ArangoCollectionAsync;
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.async.ArangoDatabaseAsync;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+import java.util.concurrent.ExecutionException;
+
+/**
+ * @author Mark Vollmary
+ */
+public class ExampleBase {
+
+    private static final String DB_NAME = "json_example_db";
+    protected static final String COLLECTION_NAME = "json_example_collection";
+
+    private static ArangoDBAsync arangoDB;
+    protected static ArangoDatabaseAsync db;
+    protected static ArangoCollectionAsync collection;
+
+    @BeforeClass
+    public static void setUp() throws InterruptedException, ExecutionException {
+        arangoDB = new ArangoDBAsync.Builder().build();
+        if (arangoDB.db(DB_NAME).exists().get()) {
+            arangoDB.db(DB_NAME).drop().get();
+        }
+        arangoDB.createDatabase(DB_NAME).get();
+        db = arangoDB.db(DB_NAME);
+        db.createCollection(COLLECTION_NAME).get();
+        collection = db.collection(COLLECTION_NAME);
+    }
+
+    @AfterClass
+    public static void tearDown() throws InterruptedException, ExecutionException {
+        db.drop().get();
+        arangoDB.shutdown();
+    }
+
+}
diff --git a/src/test/java/com/arangodb/example/document/AqlQueryWithSpecialReturnTypesExample.java b/src/test/java/com/arangodb/async/example/document/AqlQueryWithSpecialReturnTypesExample.java
similarity index 96%
rename from src/test/java/com/arangodb/example/document/AqlQueryWithSpecialReturnTypesExample.java
rename to src/test/java/com/arangodb/async/example/document/AqlQueryWithSpecialReturnTypesExample.java
index 5dd6145..cff9058 100644
--- a/src/test/java/com/arangodb/example/document/AqlQueryWithSpecialReturnTypesExample.java
+++ b/src/test/java/com/arangodb/async/example/document/AqlQueryWithSpecialReturnTypesExample.java
@@ -1,138 +1,138 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.document;
-
-import com.arangodb.entity.BaseDocument;
-import com.arangodb.example.ExampleBase;
-import com.arangodb.util.MapBuilder;
-import com.arangodb.velocypack.VPackSlice;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.assertThat;
-
-/**
- * @author Mark Vollmary
- */
-public class AqlQueryWithSpecialReturnTypesExample extends ExampleBase {
-
-    @BeforeClass
-    public static void before() throws InterruptedException, ExecutionException {
-        createExamples();
-    }
-
-    public enum Gender {
-        MALE, FEMALE
-    }
-
-    private static void createExamples() throws InterruptedException, ExecutionException {
-        for (int i = 0; i < 100; i++) {
-            final BaseDocument value = new BaseDocument();
-            value.addAttribute("name", "TestUser" + i);
-            value.addAttribute("gender", (i % 2) == 0 ? Gender.MALE : Gender.FEMALE);
-            value.addAttribute("age", i + 10);
-            db.collection(COLLECTION_NAME).insertDocument(value).get();
-        }
-    }
-
-    @Test
-    public void aqlWithLimitQueryAsVPackObject() throws InterruptedException, ExecutionException {
-        final String query = "FOR t IN " + COLLECTION_NAME
-                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN t";
-        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
-        db.query(query, bindVars, null, VPackSlice.class)
-                .whenComplete((cursor, ex) -> {
-                    assertThat(cursor, is(notNullValue()));
-                    cursor.forEachRemaining(vpack -> {
-                        assertThat(vpack.get("name").getAsString(),
-                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
-                        assertThat(vpack.get("gender").getAsString(), is(Gender.FEMALE.name()));
-                        assertThat(vpack.get("age").getAsInt(), isOneOf(21, 23, 25, 27, 29));
-                    });
-                })
-                .get();
-    }
-
-    @Test
-    public void aqlWithLimitQueryAsVPackArray() throws InterruptedException, ExecutionException {
-        final String query = "FOR t IN " + COLLECTION_NAME
-                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN [t.name, t.gender, t.age]";
-        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
-        db.query(query, bindVars, null, VPackSlice.class)
-                .whenComplete((cursor, ex) -> {
-                    assertThat(cursor, is(notNullValue()));
-                    cursor.forEachRemaining(vpack -> {
-                        assertThat(vpack.get(0).getAsString(),
-                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
-                        assertThat(vpack.get(1).getAsString(), is(Gender.FEMALE.name()));
-                        assertThat(vpack.get(2).getAsInt(), isOneOf(21, 23, 25, 27, 29));
-                    });
-                })
-                .get();
-    }
-
-    @Test
-    public void aqlWithLimitQueryAsMap() throws InterruptedException, ExecutionException {
-        final String query = "FOR t IN " + COLLECTION_NAME
-                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN t";
-        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
-        db.query(query, bindVars, null, Map.class)
-                .whenComplete((cursor, ex) -> {
-                    assertThat(cursor, is(notNullValue()));
-                    cursor.forEachRemaining(map -> {
-                        assertThat(map.get("name"), is(notNullValue()));
-                        assertThat(String.valueOf(map.get("name")),
-                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
-                        assertThat(map.get("gender"), is(notNullValue()));
-                        assertThat(String.valueOf(map.get("gender")), is(Gender.FEMALE.name()));
-                        assertThat(map.get("age"), is(notNullValue()));
-                        assertThat(Long.valueOf(map.get("age").toString()), isOneOf(21L, 23L, 25L, 27L, 29L));
-                    });
-                })
-                .get();
-    }
-
-    @Test
-    public void aqlWithLimitQueryAsList() throws InterruptedException, ExecutionException {
-        final String query = "FOR t IN " + COLLECTION_NAME
-                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN [t.name, t.gender, t.age]";
-        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
-        db.query(query, bindVars, null, List.class)
-                .whenComplete((cursor, ex) -> {
-                    assertThat(cursor, is(notNullValue()));
-                    cursor.forEachRemaining(list -> {
-                        assertThat(list.get(0), is(notNullValue()));
-                        assertThat(String.valueOf(list.get(0)),
-                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
-                        assertThat(list.get(1), is(notNullValue()));
-                        assertThat(Gender.valueOf(String.valueOf(list.get(1))), is(Gender.FEMALE));
-                        assertThat(list.get(2), is(notNullValue()));
-                        assertThat(Long.valueOf(String.valueOf(list.get(2))), isOneOf(21L, 23L, 25L, 27L, 29L));
-                    });
-                })
-                .get();
-    }
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.document;
+
+import com.arangodb.async.example.ExampleBase;
+import com.arangodb.entity.BaseDocument;
+import com.arangodb.util.MapBuilder;
+import com.arangodb.velocypack.VPackSlice;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Mark Vollmary
+ */
+public class AqlQueryWithSpecialReturnTypesExample extends ExampleBase {
+
+    @BeforeClass
+    public static void before() throws InterruptedException, ExecutionException {
+        createExamples();
+    }
+
+    public enum Gender {
+        MALE, FEMALE
+    }
+
+    private static void createExamples() throws InterruptedException, ExecutionException {
+        for (int i = 0; i < 100; i++) {
+            final BaseDocument value = new BaseDocument();
+            value.addAttribute("name", "TestUser" + i);
+            value.addAttribute("gender", (i % 2) == 0 ? Gender.MALE : Gender.FEMALE);
+            value.addAttribute("age", i + 10);
+            db.collection(COLLECTION_NAME).insertDocument(value).get();
+        }
+    }
+
+    @Test
+    public void aqlWithLimitQueryAsVPackObject() throws InterruptedException, ExecutionException {
+        final String query = "FOR t IN " + COLLECTION_NAME
+                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN t";
+        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
+        db.query(query, bindVars, null, VPackSlice.class)
+                .whenComplete((cursor, ex) -> {
+                    assertThat(cursor, is(notNullValue()));
+                    cursor.forEachRemaining(vpack -> {
+                        assertThat(vpack.get("name").getAsString(),
+                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
+                        assertThat(vpack.get("gender").getAsString(), is(Gender.FEMALE.name()));
+                        assertThat(vpack.get("age").getAsInt(), isOneOf(21, 23, 25, 27, 29));
+                    });
+                })
+                .get();
+    }
+
+    @Test
+    public void aqlWithLimitQueryAsVPackArray() throws InterruptedException, ExecutionException {
+        final String query = "FOR t IN " + COLLECTION_NAME
+                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN [t.name, t.gender, t.age]";
+        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
+        db.query(query, bindVars, null, VPackSlice.class)
+                .whenComplete((cursor, ex) -> {
+                    assertThat(cursor, is(notNullValue()));
+                    cursor.forEachRemaining(vpack -> {
+                        assertThat(vpack.get(0).getAsString(),
+                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
+                        assertThat(vpack.get(1).getAsString(), is(Gender.FEMALE.name()));
+                        assertThat(vpack.get(2).getAsInt(), isOneOf(21, 23, 25, 27, 29));
+                    });
+                })
+                .get();
+    }
+
+    @Test
+    public void aqlWithLimitQueryAsMap() throws InterruptedException, ExecutionException {
+        final String query = "FOR t IN " + COLLECTION_NAME
+                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN t";
+        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
+        db.query(query, bindVars, null, Map.class)
+                .whenComplete((cursor, ex) -> {
+                    assertThat(cursor, is(notNullValue()));
+                    cursor.forEachRemaining(map -> {
+                        assertThat(map.get("name"), is(notNullValue()));
+                        assertThat(String.valueOf(map.get("name")),
+                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
+                        assertThat(map.get("gender"), is(notNullValue()));
+                        assertThat(String.valueOf(map.get("gender")), is(Gender.FEMALE.name()));
+                        assertThat(map.get("age"), is(notNullValue()));
+                        assertThat(Long.valueOf(map.get("age").toString()), isOneOf(21L, 23L, 25L, 27L, 29L));
+                    });
+                })
+                .get();
+    }
+
+    @Test
+    public void aqlWithLimitQueryAsList() throws InterruptedException, ExecutionException {
+        final String query = "FOR t IN " + COLLECTION_NAME
+                + " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN [t.name, t.gender, t.age]";
+        final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
+        db.query(query, bindVars, null, List.class)
+                .whenComplete((cursor, ex) -> {
+                    assertThat(cursor, is(notNullValue()));
+                    cursor.forEachRemaining(list -> {
+                        assertThat(list.get(0), is(notNullValue()));
+                        assertThat(String.valueOf(list.get(0)),
+                                isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
+                        assertThat(list.get(1), is(notNullValue()));
+                        assertThat(Gender.valueOf(String.valueOf(list.get(1))), is(Gender.FEMALE));
+                        assertThat(list.get(2), is(notNullValue()));
+                        assertThat(Long.valueOf(String.valueOf(list.get(2))), isOneOf(21L, 23L, 25L, 27L, 29L));
+                    });
+                })
+                .get();
+    }
+}
diff --git a/src/test/java/com/arangodb/example/document/GetDocumentExample.java b/src/test/java/com/arangodb/async/example/document/GetDocumentExample.java
similarity index 97%
rename from src/test/java/com/arangodb/example/document/GetDocumentExample.java
rename to src/test/java/com/arangodb/async/example/document/GetDocumentExample.java
index 9c80e9e..e23623e 100644
--- a/src/test/java/com/arangodb/example/document/GetDocumentExample.java
+++ b/src/test/java/com/arangodb/async/example/document/GetDocumentExample.java
@@ -18,21 +18,20 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.example.document;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertThat;
-
-import java.util.concurrent.ExecutionException;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
+package com.arangodb.async.example.document;
 
+import com.arangodb.async.example.ExampleBase;
 import com.arangodb.entity.BaseDocument;
 import com.arangodb.entity.DocumentCreateEntity;
-import com.arangodb.example.ExampleBase;
 import com.arangodb.velocypack.VPackSlice;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
 
 /**
  * @author Mark Vollmary
diff --git a/src/test/java/com/arangodb/example/document/ImportDocumentExample.java b/src/test/java/com/arangodb/async/example/document/ImportDocumentExample.java
similarity index 96%
rename from src/test/java/com/arangodb/example/document/ImportDocumentExample.java
rename to src/test/java/com/arangodb/async/example/document/ImportDocumentExample.java
index 716e1da..e320d15 100644
--- a/src/test/java/com/arangodb/example/document/ImportDocumentExample.java
+++ b/src/test/java/com/arangodb/async/example/document/ImportDocumentExample.java
@@ -18,10 +18,10 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.example.document;
+package com.arangodb.async.example.document;
 
+import com.arangodb.async.example.ExampleBase;
 import com.arangodb.entity.DocumentImportEntity;
-import com.arangodb.example.ExampleBase;
 import com.arangodb.model.DocumentImportOptions;
 import org.junit.Test;
 
diff --git a/src/test/java/com/arangodb/example/document/InsertDocumentExample.java b/src/test/java/com/arangodb/async/example/document/InsertDocumentExample.java
similarity index 94%
rename from src/test/java/com/arangodb/example/document/InsertDocumentExample.java
rename to src/test/java/com/arangodb/async/example/document/InsertDocumentExample.java
index 757ed81..55a1dd5 100644
--- a/src/test/java/com/arangodb/example/document/InsertDocumentExample.java
+++ b/src/test/java/com/arangodb/async/example/document/InsertDocumentExample.java
@@ -1,72 +1,72 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.document;
-
-import com.arangodb.entity.BaseDocument;
-import com.arangodb.example.ExampleBase;
-import com.arangodb.velocypack.VPackBuilder;
-import com.arangodb.velocypack.ValueType;
-import org.junit.Test;
-
-import java.util.concurrent.ExecutionException;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertThat;
-
-/**
- * @author Mark Vollmary
- */
-public class InsertDocumentExample extends ExampleBase {
-
-    @Test
-    public void insertBean() throws ExecutionException, InterruptedException {
-        collection.insertDocument(new TestEntity("bar"))
-                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
-                .get();
-    }
-
-    @Test
-    public void insertBaseDocument() throws ExecutionException, InterruptedException {
-        final BaseDocument value = new BaseDocument();
-        value.addAttribute("foo", "bar");
-        collection.insertDocument(value)
-                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
-                .get();
-    }
-
-    @Test
-    public void insertVPack() throws ExecutionException, InterruptedException {
-        final VPackBuilder builder = new VPackBuilder();
-        builder.add(ValueType.OBJECT).add("foo", "bar").close();
-        collection.insertDocument(builder.slice())
-                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
-                .get();
-    }
-
-    @Test
-    public void insertJson() throws ExecutionException, InterruptedException {
-        collection.insertDocument("{\"foo\":\"bar\"}")
-                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
-                .get();
-    }
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.document;
+
+import com.arangodb.async.example.ExampleBase;
+import com.arangodb.entity.BaseDocument;
+import com.arangodb.velocypack.VPackBuilder;
+import com.arangodb.velocypack.ValueType;
+import org.junit.Test;
+
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Mark Vollmary
+ */
+public class InsertDocumentExample extends ExampleBase {
+
+    @Test
+    public void insertBean() throws ExecutionException, InterruptedException {
+        collection.insertDocument(new TestEntity("bar"))
+                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
+                .get();
+    }
+
+    @Test
+    public void insertBaseDocument() throws ExecutionException, InterruptedException {
+        final BaseDocument value = new BaseDocument();
+        value.addAttribute("foo", "bar");
+        collection.insertDocument(value)
+                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
+                .get();
+    }
+
+    @Test
+    public void insertVPack() throws ExecutionException, InterruptedException {
+        final VPackBuilder builder = new VPackBuilder();
+        builder.add(ValueType.OBJECT).add("foo", "bar").close();
+        collection.insertDocument(builder.slice())
+                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
+                .get();
+    }
+
+    @Test
+    public void insertJson() throws ExecutionException, InterruptedException {
+        collection.insertDocument("{\"foo\":\"bar\"}")
+                .whenComplete((doc, ex) -> assertThat(doc.getKey(), is(notNullValue())))
+                .get();
+    }
+
+}
diff --git a/src/test/java/com/arangodb/example/document/TestEntity.java b/src/test/java/com/arangodb/async/example/document/TestEntity.java
similarity index 92%
rename from src/test/java/com/arangodb/example/document/TestEntity.java
rename to src/test/java/com/arangodb/async/example/document/TestEntity.java
index ee9beba..1944f02 100644
--- a/src/test/java/com/arangodb/example/document/TestEntity.java
+++ b/src/test/java/com/arangodb/async/example/document/TestEntity.java
@@ -1,49 +1,49 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.document;
-
-/**
- * @author Mark Vollmary
- *
- */
-@SuppressWarnings({"WeakerAccess", "unused"})
-public class TestEntity {
-
-	private String foo;
-
-	public TestEntity() {
-		super();
-	}
-
-	public TestEntity(final String foo) {
-		super();
-		this.foo = foo;
-	}
-
-	public String getFoo() {
-		return foo;
-	}
-
-	public void setFoo(final String foo) {
-		this.foo = foo;
-	}
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.document;
+
+/**
+ * @author Mark Vollmary
+ *
+ */
+@SuppressWarnings({"WeakerAccess", "unused"})
+public class TestEntity {
+
+	private String foo;
+
+	public TestEntity() {
+		super();
+	}
+
+	public TestEntity(final String foo) {
+		super();
+		this.foo = foo;
+	}
+
+	public String getFoo() {
+		return foo;
+	}
+
+	public void setFoo(final String foo) {
+		this.foo = foo;
+	}
+
+}
diff --git a/src/test/java/com/arangodb/example/graph/AQLActorsAndMoviesExample.java b/src/test/java/com/arangodb/async/example/graph/AQLActorsAndMoviesExample.java
similarity index 97%
rename from src/test/java/com/arangodb/example/graph/AQLActorsAndMoviesExample.java
rename to src/test/java/com/arangodb/async/example/graph/AQLActorsAndMoviesExample.java
index 9048242..b60b019 100644
--- a/src/test/java/com/arangodb/example/graph/AQLActorsAndMoviesExample.java
+++ b/src/test/java/com/arangodb/async/example/graph/AQLActorsAndMoviesExample.java
@@ -1,583 +1,582 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.graph;
-
-import static org.hamcrest.Matchers.hasItems;
-import static org.junit.Assert.assertThat;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.arangodb.ArangoCollectionAsync;
-import com.arangodb.ArangoCursorAsync;
-import com.arangodb.ArangoDBAsync;
-import com.arangodb.ArangoDatabaseAsync;
-import com.arangodb.entity.BaseDocument;
-import com.arangodb.entity.BaseEdgeDocument;
-import com.arangodb.entity.CollectionType;
-import com.arangodb.entity.DocumentCreateEntity;
-import com.arangodb.model.CollectionCreateOptions;
-
-/**
- * @author Mark Vollmary
- * @see <a href="https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html">AQL Example Queries on an
- * Actors and Movies Database</a>
- */
-@SuppressWarnings("JavaDoc")
-public class AQLActorsAndMoviesExample {
-
-    private static final String TEST_DB = "actors_movies_test_db";
-    private static ArangoDBAsync arangoDB;
-    private static ArangoDatabaseAsync db;
-
-    @BeforeClass
-    public static void setUp() throws InterruptedException, ExecutionException {
-        arangoDB = new ArangoDBAsync.Builder().build();
-        if (arangoDB.db(TEST_DB).exists().get()) {
-			arangoDB.db(TEST_DB).drop().get();
-		}
-        arangoDB.createDatabase(TEST_DB).get();
-        db = arangoDB.db(TEST_DB);
-        createData();
-    }
-
-    @AfterClass
-    public static void tearDown() throws InterruptedException, ExecutionException {
-        db.drop().get();
-        arangoDB.shutdown();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-movie1-or-movie2">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void allActorsActsInMovie1or2() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
-                "WITH actors FOR x IN ANY 'movies/TheMatrix' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN x._id",
-                null, null, String.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems("actors/Keanu", "actors/Hugo", "actors/Emil", "actors/Carrie", "actors/Laurence"))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-movie1-or-movie2">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void allActorsActsInMovie1or2UnionDistinct() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
-                "WITH actors FOR x IN UNION_DISTINCT ((FOR y IN ANY 'movies/TheMatrix' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id), (FOR y IN ANY 'movies/TheDevilsAdvocate' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id)) RETURN x",
-                null, null, String.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(), hasItems("actors/Emil", "actors/Hugo", "actors/Carrie",
-                "actors/Laurence", "actors/Keanu", "actors/Al", "actors/Charlize"))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-both-movie1-and-movie2-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void allActorsActsInMovie1and2() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
-                "WITH actors FOR x IN INTERSECTION ((FOR y IN ANY 'movies/TheMatrix' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id), (FOR y IN ANY 'movies/TheDevilsAdvocate' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id)) RETURN x",
-                null, null, String.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(), hasItems("actors/Keanu"))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-common-movies-between-actor1-and-actor2-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void allMoviesBetweenActor1andActor2() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
-                "WITH movies FOR x IN INTERSECTION ((FOR y IN ANY 'actors/Hugo' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id), (FOR y IN ANY 'actors/Keanu' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id)) RETURN x",
-                null, null, String.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems("movies/TheMatrixRevolutions", "movies/TheMatrixReloaded", "movies/TheMatrix"))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-3-or-more-movies-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void allActorsWhoActedIn3orMoreMovies() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<Actor>> f = db.query(
-                "FOR x IN actsIn COLLECT actor = x._from WITH COUNT INTO counter FILTER counter >= 3 RETURN {actor: actor, movies: counter}",
-                null, null, Actor.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems(new Actor("actors/Carrie", 3), new Actor("actors/CubaG", 4), new Actor("actors/Hugo", 3),
-                        new Actor("actors/Keanu", 4), new Actor("actors/Laurence", 3), new Actor("actors/MegR", 5),
-                        new Actor("actors/TomC", 3), new Actor("actors/TomH", 3)))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-movies-where-exactly-6-actors-acted-in-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void allMoviesWhereExactly6ActorsActedIn() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
-                "FOR x IN actsIn COLLECT movie = x._to WITH COUNT INTO counter FILTER counter == 6 RETURN movie", null,
-                null, String.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems("movies/SleeplessInSeattle", "movies/TopGun", "movies/YouveGotMail"))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#the-number-of-actors-by-movie-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void theNumberOfActorsByMovie() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<Movie>> f = db.query(
-                "FOR x IN actsIn COLLECT movie = x._to WITH COUNT INTO counter RETURN {movie: movie, actors: counter}",
-                null, null, Movie.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems(new Movie("movies/AFewGoodMen", 11), new Movie("movies/AsGoodAsItGets", 4),
-                        new Movie("movies/JerryMaguire", 9), new Movie("movies/JoeVersustheVolcano", 3),
-                        new Movie("movies/SleeplessInSeattle", 6), new Movie("movies/SnowFallingonCedars", 4),
-                        new Movie("movies/StandByMe", 7), new Movie("movies/TheDevilsAdvocate", 3),
-                        new Movie("movies/TheMatrix", 5), new Movie("movies/TheMatrixReloaded", 4),
-                        new Movie("movies/TheMatrixRevolutions", 4), new Movie("movies/TopGun", 6),
-                        new Movie("movies/WhatDreamsMayCome", 5), new Movie("movies/WhenHarryMetSally", 4),
-                        new Movie("movies/YouveGotMail", 6)))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#the-number-of-movies-by-actor-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void theNumberOfMoviesByActor() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<Actor>> f = db.query(
-                "FOR x IN actsIn COLLECT actor = x._from WITH COUNT INTO counter RETURN {actor: actor, movies: counter}",
-                null, null, Actor.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems(new Actor("actors/Al", 1), new Actor("actors/AnnabellaS", 1), new Actor("actors/AnthonyE", 1),
-                        new Actor("actors/BillPull", 1), new Actor("actors/BillyC", 1), new Actor("actors/BonnieH", 1),
-                        new Actor("actors/BrunoK", 1), new Actor("actors/Carrie", 3), new Actor("actors/CarrieF", 1),
-                        new Actor("actors/Charlize", 1), new Actor("actors/ChristopherG", 1), new Actor("actors/CoreyF", 1),
-                        new Actor("actors/CubaG", 4), new Actor("actors/DaveC", 1), new Actor("actors/DemiM", 1),
-                        new Actor("actors/Emil", 1), new Actor("actors/EthanH", 1), new Actor("actors/GregK", 2),
-                        new Actor("actors/HelenH", 1), new Actor("actors/Hugo", 3), new Actor("actors/JackN", 2),
-                        new Actor("actors/JamesC", 1), new Actor("actors/JamesM", 1), new Actor("actors/JayM", 1),
-                        new Actor("actors/JerryO", 2), new Actor("actors/JohnC", 1), new Actor("actors/JonathanL", 1),
-                        new Actor("actors/JTW", 1), new Actor("actors/Keanu", 4), new Actor("actors/KellyM", 1),
-                        new Actor("actors/KellyP", 1), new Actor("actors/KevinB", 1), new Actor("actors/KevinP", 1),
-                        new Actor("actors/KieferS", 2), new Actor("actors/Laurence", 3), new Actor("actors/MarshallB", 1),
-                        new Actor("actors/MaxS", 2), new Actor("actors/MegR", 5), new Actor("actors/Nathan", 1),
-                        new Actor("actors/NoahW", 1), new Actor("actors/ParkerP", 1), new Actor("actors/ReginaK", 1),
-                        new Actor("actors/ReneeZ", 1), new Actor("actors/RickY", 1), new Actor("actors/RitaW", 1),
-                        new Actor("actors/RiverP", 1), new Actor("actors/Robin", 1), new Actor("actors/RosieO", 1),
-                        new Actor("actors/SteveZ", 1), new Actor("actors/TomC", 3), new Actor("actors/TomH", 3),
-                        new Actor("actors/TomS", 1), new Actor("actors/ValK", 1), new Actor("actors/VictorG", 1),
-                        new Actor("actors/WernerH", 1), new Actor("actors/WilW", 1)))).get();
-    }
-
-    /**
-     * @throws ExecutionException
-     * @throws InterruptedException
-     * @see <a href=
-     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#the-number-of-movies-acted-in-between-2005-and-2010-by-actor-">AQL
-     * Example Queries on an Actors and Movies Database</a>
-     */
-    @Test
-    public void theNumberOfMoviesActedInBetween2005and2010byActor() throws InterruptedException, ExecutionException {
-        final CompletableFuture<ArangoCursorAsync<Actor>> f = db.query(
-                "FOR x IN actsIn FILTER x.year >= 1990 && x.year <= 1995 COLLECT actor = x._from WITH COUNT INTO counter RETURN {actor: actor, movies: counter}",
-                null, null, Actor.class);
-        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
-                hasItems(new Actor("actors/BillPull", 1), new Actor("actors/ChristopherG", 1),
-                        new Actor("actors/CubaG", 1), new Actor("actors/DemiM", 1), new Actor("actors/JackN", 1),
-                        new Actor("actors/JamesM", 1), new Actor("actors/JTW", 1), new Actor("actors/KevinB", 1),
-                        new Actor("actors/KieferS", 1), new Actor("actors/MegR", 2), new Actor("actors/Nathan", 1),
-                        new Actor("actors/NoahW", 1), new Actor("actors/RitaW", 1), new Actor("actors/RosieO", 1),
-                        new Actor("actors/TomC", 1), new Actor("actors/TomH", 2), new Actor("actors/VictorG", 1)))).get();
-    }
-
-    @SuppressWarnings("WeakerAccess")
-    public static class Actor {
-        private String actor;
-        private Integer movies;
-
-        public Actor() {
-            super();
-        }
-
-        public Actor(final String actor, final Integer movies) {
-            super();
-            this.actor = actor;
-            this.movies = movies;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((actor == null) ? 0 : actor.hashCode());
-            result = prime * result + ((movies == null) ? 0 : movies.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            final Actor other = (Actor) obj;
-            if (actor == null) {
-                if (other.actor != null) {
-                    return false;
-                }
-            } else if (!actor.equals(other.actor)) {
-                return false;
-            }
-            if (movies == null) {
-                return other.movies == null;
-            } else return movies.equals(other.movies);
-        }
-
-    }
-
-    @SuppressWarnings("WeakerAccess")
-    public static class Movie {
-        private String movie;
-        private Integer actors;
-
-        public Movie() {
-            super();
-        }
-
-        public Movie(final String movie, final Integer actors) {
-            super();
-            this.movie = movie;
-            this.actors = actors;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((actors == null) ? 0 : actors.hashCode());
-            result = prime * result + ((movie == null) ? 0 : movie.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            final Movie other = (Movie) obj;
-            if (actors == null) {
-                if (other.actors != null) {
-                    return false;
-                }
-            } else if (!actors.equals(other.actors)) {
-                return false;
-            }
-            if (movie == null) {
-                return other.movie == null;
-            } else return movie.equals(other.movie);
-        }
-
-    }
-
-    private static DocumentCreateEntity<BaseDocument> saveMovie(
-            final ArangoCollectionAsync movies,
-            final String key,
-            final String title,
-            final int released,
-            final String tagline) throws InterruptedException, ExecutionException {
-        final BaseDocument value = new BaseDocument();
-        value.setKey(key);
-        value.addAttribute("title", title);
-        value.addAttribute("released", released);
-        value.addAttribute("tagline", tagline);
-        return movies.insertDocument(value).get();
-    }
-
-    private static DocumentCreateEntity<BaseDocument> saveActor(
-            final ArangoCollectionAsync actors,
-            final String key,
-            final String name,
-            final int born) throws InterruptedException, ExecutionException {
-        final BaseDocument value = new BaseDocument();
-        value.setKey(key);
-        value.addAttribute("name", name);
-        value.addAttribute("born", born);
-        return actors.insertDocument(value).get();
-    }
-
-    private static void saveActsIn(
-            final ArangoCollectionAsync actsIn,
-            final String actor,
-            final String movie,
-            final String[] roles,
-            final int year) throws InterruptedException, ExecutionException {
-        final BaseEdgeDocument value = new BaseEdgeDocument();
-        value.setFrom(actor);
-        value.setTo(movie);
-        value.addAttribute("roles", roles);
-        value.addAttribute("year", year);
-        actsIn.insertDocument(value).get();
-    }
-
-    private static void createData() throws InterruptedException, ExecutionException {
-        db.createCollection("actors").get();
-        final ArangoCollectionAsync actors = db.collection("actors");
-        db.createCollection("movies").get();
-        final ArangoCollectionAsync movies = db.collection("movies");
-        db.createCollection("actsIn", new CollectionCreateOptions().type(CollectionType.EDGES)).get();
-        final ArangoCollectionAsync actsIn = db.collection("actsIn");
-
-        final String theMatrix = saveMovie(movies, "TheMatrix", "The Matrix", 1999, "Welcome to the Real World")
-                .getId();
-        final String keanu = saveActor(actors, "Keanu", "Keanu Reeves", 1964).getId();
-        final String carrie = saveActor(actors, "Carrie", "Carrie-Anne Moss", 1967).getId();
-        final String laurence = saveActor(actors, "Laurence", "Laurence Fishburne", 1961).getId();
-        final String hugo = saveActor(actors, "Hugo", "Hugo Weaving", 1960).getId();
-        final String emil = saveActor(actors, "Emil", "Emil Eifrem", 1978).getId();
-
-        saveActsIn(actsIn, keanu, theMatrix, new String[]{"Neo"}, 1999);
-        saveActsIn(actsIn, carrie, theMatrix, new String[]{"Trinity"}, 1999);
-        saveActsIn(actsIn, laurence, theMatrix, new String[]{"Morpheus"}, 1999);
-        saveActsIn(actsIn, hugo, theMatrix, new String[]{"Agent Smith"}, 1999);
-        saveActsIn(actsIn, emil, theMatrix, new String[]{"Emil"}, 1999);
-
-        final String theMatrixReloaded = saveMovie(movies, "TheMatrixReloaded", "The Matrix Reloaded", 2003,
-                "Free your mind").getId();
-        saveActsIn(actsIn, keanu, theMatrixReloaded, new String[]{"Neo"}, 2003);
-        saveActsIn(actsIn, carrie, theMatrixReloaded, new String[]{"Trinity"}, 2003);
-        saveActsIn(actsIn, laurence, theMatrixReloaded, new String[]{"Morpheus"}, 2003);
-        saveActsIn(actsIn, hugo, theMatrixReloaded, new String[]{"Agent Smith"}, 2003);
-
-        final String theMatrixRevolutions = saveMovie(movies, "TheMatrixRevolutions", "The Matrix Revolutions", 2003,
-                "Everything that has a beginning has an end").getId();
-        saveActsIn(actsIn, keanu, theMatrixRevolutions, new String[]{"Neo"}, 2003);
-        saveActsIn(actsIn, carrie, theMatrixRevolutions, new String[]{"Trinity"}, 2003);
-        saveActsIn(actsIn, laurence, theMatrixRevolutions, new String[]{"Morpheus"}, 2003);
-        saveActsIn(actsIn, hugo, theMatrixRevolutions, new String[]{"Agent Smith"}, 2003);
-
-        final String theDevilsAdvocate = saveMovie(movies, "TheDevilsAdvocate", "The Devil's Advocate", 1997,
-                "Evil has its winning ways").getId();
-        final String charlize = saveActor(actors, "Charlize", "Charlize Theron", 1975).getId();
-        final String al = saveActor(actors, "Al", "Al Pacino", 1940).getId();
-        saveActsIn(actsIn, keanu, theDevilsAdvocate, new String[]{"Kevin Lomax"}, 1997);
-        saveActsIn(actsIn, charlize, theDevilsAdvocate, new String[]{"Mary Ann Lomax"}, 1997);
-        saveActsIn(actsIn, al, theDevilsAdvocate, new String[]{"John Milton"}, 1997);
-
-        final String AFewGoodMen = saveMovie(movies, "AFewGoodMen", "A Few Good Men", 1992,
-                "In the heart of the nation's capital, in a courthouse of the U.S. government, one man will stop at nothing to keep his honor, and one will stop at nothing to find the truth.")
-                .getId();
-        final String tomC = saveActor(actors, "TomC", "Tom Cruise", 1962).getId();
-        final String jackN = saveActor(actors, "JackN", "Jack Nicholson", 1937).getId();
-        final String demiM = saveActor(actors, "DemiM", "Demi Moore", 1962).getId();
-        final String kevinB = saveActor(actors, "KevinB", "Kevin Bacon", 1958).getId();
-        final String kieferS = saveActor(actors, "KieferS", "Kiefer Sutherland", 1966).getId();
-        final String noahW = saveActor(actors, "NoahW", "Noah Wyle", 1971).getId();
-        final String cubaG = saveActor(actors, "CubaG", "Cuba Gooding Jr.", 1968).getId();
-        final String kevinP = saveActor(actors, "KevinP", "Kevin Pollak", 1957).getId();
-        final String jTW = saveActor(actors, "JTW", "J.T. Walsh", 1943).getId();
-        final String jamesM = saveActor(actors, "JamesM", "James Marshall", 1967).getId();
-        final String christopherG = saveActor(actors, "ChristopherG", "Christopher Guest", 1948).getId();
-        saveActsIn(actsIn, tomC, AFewGoodMen, new String[]{"Lt. Daniel Kaffee"}, 1992);
-        saveActsIn(actsIn, jackN, AFewGoodMen, new String[]{"Col. Nathan R. Jessup"}, 1992);
-        saveActsIn(actsIn, demiM, AFewGoodMen, new String[]{"Lt. Cdr. JoAnne Galloway"}, 1992);
-        saveActsIn(actsIn, kevinB, AFewGoodMen, new String[]{"Capt. Jack Ross"}, 1992);
-        saveActsIn(actsIn, kieferS, AFewGoodMen, new String[]{"Lt. Jonathan Kendrick"}, 1992);
-        saveActsIn(actsIn, noahW, AFewGoodMen, new String[]{"Cpl. Jeffrey Barnes"}, 1992);
-        saveActsIn(actsIn, cubaG, AFewGoodMen, new String[]{"Cpl. Carl Hammaker"}, 1992);
-        saveActsIn(actsIn, kevinP, AFewGoodMen, new String[]{"Lt. Sam Weinberg"}, 1992);
-        saveActsIn(actsIn, jTW, AFewGoodMen, new String[]{"Lt. Col. Matthew Andrew Markinson"}, 1992);
-        saveActsIn(actsIn, jamesM, AFewGoodMen, new String[]{"Pfc. Louden Downey"}, 1992);
-        saveActsIn(actsIn, christopherG, AFewGoodMen, new String[]{"Dr. Stone"}, 1992);
-
-        final String topGun = saveMovie(movies, "TopGun", "Top Gun", 1986, "I feel the need, the need for speed.")
-                .getId();
-        final String kellyM = saveActor(actors, "KellyM", "Kelly McGillis", 1957).getId();
-        final String valK = saveActor(actors, "ValK", "Val Kilmer", 1959).getId();
-        final String anthonyE = saveActor(actors, "AnthonyE", "Anthony Edwards", 1962).getId();
-        final String tomS = saveActor(actors, "TomS", "Tom Skerritt", 1933).getId();
-        final String megR = saveActor(actors, "MegR", "Meg Ryan", 1961).getId();
-        saveActsIn(actsIn, tomC, topGun, new String[]{"Maverick"}, 1986);
-        saveActsIn(actsIn, kellyM, topGun, new String[]{"Charlie"}, 1986);
-        saveActsIn(actsIn, valK, topGun, new String[]{"Iceman"}, 1986);
-        saveActsIn(actsIn, anthonyE, topGun, new String[]{"Goose"}, 1986);
-        saveActsIn(actsIn, tomS, topGun, new String[]{"Viper"}, 1986);
-        saveActsIn(actsIn, megR, topGun, new String[]{"Carole"}, 1986);
-
-        final String jerryMaguire = saveMovie(movies, "JerryMaguire", "Jerry Maguire", 2000,
-                "The rest of his life begins now.").getId();
-        final String reneeZ = saveActor(actors, "ReneeZ", "Renee Zellweger", 1969).getId();
-        final String kellyP = saveActor(actors, "KellyP", "Kelly Preston", 1962).getId();
-        final String jerryO = saveActor(actors, "JerryO", "Jerry O'Connell", 1974).getId();
-        final String jayM = saveActor(actors, "JayM", "Jay Mohr", 1970).getId();
-        final String bonnieH = saveActor(actors, "BonnieH", "Bonnie Hunt", 1961).getId();
-        final String reginaK = saveActor(actors, "ReginaK", "Regina King", 1971).getId();
-        final String jonathanL = saveActor(actors, "JonathanL", "Jonathan Lipnicki", 1996).getId();
-        saveActsIn(actsIn, tomC, jerryMaguire, new String[]{"Jerry Maguire"}, 2000);
-        saveActsIn(actsIn, cubaG, jerryMaguire, new String[]{"Rod Tidwell"}, 2000);
-        saveActsIn(actsIn, reneeZ, jerryMaguire, new String[]{"Dorothy Boyd"}, 2000);
-        saveActsIn(actsIn, kellyP, jerryMaguire, new String[]{"Avery Bishop"}, 2000);
-        saveActsIn(actsIn, jerryO, jerryMaguire, new String[]{"Frank Cushman"}, 2000);
-        saveActsIn(actsIn, jayM, jerryMaguire, new String[]{"Bob Sugar"}, 2000);
-        saveActsIn(actsIn, bonnieH, jerryMaguire, new String[]{"Laurel Boyd"}, 2000);
-        saveActsIn(actsIn, reginaK, jerryMaguire, new String[]{"Marcee Tidwell"}, 2000);
-        saveActsIn(actsIn, jonathanL, jerryMaguire, new String[]{"Ray Boyd"}, 2000);
-
-        final String standByMe = saveMovie(movies, "StandByMe", "Stand By Me", 1986,
-                "For some, it's the last real taste of innocence, and the first real taste of life. But for everyone, it's the time that memories are made of.")
-                .getId();
-        final String riverP = saveActor(actors, "RiverP", "River Phoenix", 1970).getId();
-        final String coreyF = saveActor(actors, "CoreyF", "Corey Feldman", 1971).getId();
-        final String wilW = saveActor(actors, "WilW", "Wil Wheaton", 1972).getId();
-        final String johnC = saveActor(actors, "JohnC", "John Cusack", 1966).getId();
-        final String marshallB = saveActor(actors, "MarshallB", "Marshall Bell", 1942).getId();
-        saveActsIn(actsIn, wilW, standByMe, new String[]{"Gordie Lachance"}, 1986);
-        saveActsIn(actsIn, riverP, standByMe, new String[]{"Chris Chambers"}, 1986);
-        saveActsIn(actsIn, jerryO, standByMe, new String[]{"Vern Tessio"}, 1986);
-        saveActsIn(actsIn, coreyF, standByMe, new String[]{"Teddy Duchamp"}, 1986);
-        saveActsIn(actsIn, johnC, standByMe, new String[]{"Denny Lachance"}, 1986);
-        saveActsIn(actsIn, kieferS, standByMe, new String[]{"Ace Merrill"}, 1986);
-        saveActsIn(actsIn, marshallB, standByMe, new String[]{"Mr. Lachance"}, 1986);
-
-        final String asGoodAsItGets = saveMovie(movies, "AsGoodAsItGets", "As Good as It Gets", 1997,
-                "A comedy from the heart that goes for the throat.").getId();
-        final String helenH = saveActor(actors, "HelenH", "Helen Hunt", 1963).getId();
-        final String gregK = saveActor(actors, "GregK", "Greg Kinnear", 1963).getId();
-        saveActsIn(actsIn, jackN, asGoodAsItGets, new String[]{"Melvin Udall"}, 1997);
-        saveActsIn(actsIn, helenH, asGoodAsItGets, new String[]{"Carol Connelly"}, 1997);
-        saveActsIn(actsIn, gregK, asGoodAsItGets, new String[]{"Simon Bishop"}, 1997);
-        saveActsIn(actsIn, cubaG, asGoodAsItGets, new String[]{"Frank Sachs"}, 1997);
-
-        final String whatDreamsMayCome = saveMovie(movies, "WhatDreamsMayCome", "What Dreams May Come", 1998,
-                "After life there is more. The end is just the beginning.").getId();
-        final String annabellaS = saveActor(actors, "AnnabellaS", "Annabella Sciorra", 1960).getId();
-        final String maxS = saveActor(actors, "MaxS", "Max von Sydow", 1929).getId();
-        final String wernerH = saveActor(actors, "WernerH", "Werner Herzog", 1942).getId();
-        final String robin = saveActor(actors, "Robin", "Robin Williams", 1951).getId();
-        saveActsIn(actsIn, robin, whatDreamsMayCome, new String[]{"Chris Nielsen"}, 1998);
-        saveActsIn(actsIn, cubaG, whatDreamsMayCome, new String[]{"Albert Lewis"}, 1998);
-        saveActsIn(actsIn, annabellaS, whatDreamsMayCome, new String[]{"Annie Collins-Nielsen"}, 1998);
-        saveActsIn(actsIn, maxS, whatDreamsMayCome, new String[]{"The Tracker"}, 1998);
-        saveActsIn(actsIn, wernerH, whatDreamsMayCome, new String[]{"The Face"}, 1998);
-
-        final String snowFallingonCedars = saveMovie(movies, "SnowFallingonCedars", "Snow Falling on Cedars", 1999,
-                "First loves last. Forever.").getId();
-        final String ethanH = saveActor(actors, "EthanH", "Ethan Hawke", 1970).getId();
-        final String rickY = saveActor(actors, "RickY", "Rick Yune", 1971).getId();
-        final String jamesC = saveActor(actors, "JamesC", "James Cromwell", 1940).getId();
-        saveActsIn(actsIn, ethanH, snowFallingonCedars, new String[]{"Ishmael Chambers"}, 1999);
-        saveActsIn(actsIn, rickY, snowFallingonCedars, new String[]{"Kazuo Miyamoto"}, 1999);
-        saveActsIn(actsIn, maxS, snowFallingonCedars, new String[]{"Nels Gudmundsson"}, 1999);
-        saveActsIn(actsIn, jamesC, snowFallingonCedars, new String[]{"Judge Fielding"}, 1999);
-
-        final String youveGotMail = saveMovie(movies, "YouveGotMail", "You've Got Mail", 1998,
-                "At odds in life... in love on-line.").getId();
-        final String parkerP = saveActor(actors, "ParkerP", "Parker Posey", 1968).getId();
-        final String daveC = saveActor(actors, "DaveC", "Dave Chappelle", 1973).getId();
-        final String steveZ = saveActor(actors, "SteveZ", "Steve Zahn", 1967).getId();
-        final String tomH = saveActor(actors, "TomH", "Tom Hanks", 1956).getId();
-        saveActsIn(actsIn, tomH, youveGotMail, new String[]{"Joe Fox"}, 1998);
-        saveActsIn(actsIn, megR, youveGotMail, new String[]{"Kathleen Kelly"}, 1998);
-        saveActsIn(actsIn, gregK, youveGotMail, new String[]{"Frank Navasky"}, 1998);
-        saveActsIn(actsIn, parkerP, youveGotMail, new String[]{"Patricia Eden"}, 1998);
-        saveActsIn(actsIn, daveC, youveGotMail, new String[]{"Kevin Jackson"}, 1998);
-        saveActsIn(actsIn, steveZ, youveGotMail, new String[]{"George Pappas"}, 1998);
-
-        final String sleeplessInSeattle = saveMovie(movies, "SleeplessInSeattle", "Sleepless in Seattle", 1993,
-                "What if someone you never met, someone you never saw, someone you never knew was the only someone for you?")
-                .getId();
-        final String ritaW = saveActor(actors, "RitaW", "Rita Wilson", 1956).getId();
-        final String billPull = saveActor(actors, "BillPull", "Bill Pullman", 1953).getId();
-        final String victorG = saveActor(actors, "VictorG", "Victor Garber", 1949).getId();
-        final String rosieO = saveActor(actors, "RosieO", "Rosie O'Donnell", 1962).getId();
-        saveActsIn(actsIn, tomH, sleeplessInSeattle, new String[]{"Sam Baldwin"}, 1993);
-        saveActsIn(actsIn, megR, sleeplessInSeattle, new String[]{"Annie Reed"}, 1993);
-        saveActsIn(actsIn, ritaW, sleeplessInSeattle, new String[]{"Suzy"}, 1993);
-        saveActsIn(actsIn, billPull, sleeplessInSeattle, new String[]{"Walter"}, 1993);
-        saveActsIn(actsIn, victorG, sleeplessInSeattle, new String[]{"Greg"}, 1993);
-        saveActsIn(actsIn, rosieO, sleeplessInSeattle, new String[]{"Becky"}, 1993);
-
-        final String joeVersustheVolcano = saveMovie(movies, "JoeVersustheVolcano", "Joe Versus the Volcano", 1990,
-                "A story of love, lava and burning desire.").getId();
-        final String nathan = saveActor(actors, "Nathan", "Nathan Lane", 1956).getId();
-        saveActsIn(actsIn, tomH, joeVersustheVolcano, new String[]{"Joe Banks"}, 1990);
-        saveActsIn(actsIn, megR, joeVersustheVolcano,
-                new String[]{"DeDe', 'Angelica Graynamore', 'Patricia Graynamore"}, 1990);
-        saveActsIn(actsIn, nathan, joeVersustheVolcano, new String[]{"Baw"}, 1990);
-
-        final String whenHarryMetSally = saveMovie(movies, "WhenHarryMetSally", "When Harry Met Sally", 1998,
-                "At odds in life... in love on-line.").getId();
-        final String billyC = saveActor(actors, "BillyC", "Billy Crystal", 1948).getId();
-        final String carrieF = saveActor(actors, "CarrieF", "Carrie Fisher", 1956).getId();
-        final String brunoK = saveActor(actors, "BrunoK", "Bruno Kirby", 1949).getId();
-        saveActsIn(actsIn, billyC, whenHarryMetSally, new String[]{"Harry Burns"}, 1998);
-        saveActsIn(actsIn, megR, whenHarryMetSally, new String[]{"Sally Albright"}, 1998);
-        saveActsIn(actsIn, carrieF, whenHarryMetSally, new String[]{"Marie"}, 1998);
-        saveActsIn(actsIn, brunoK, whenHarryMetSally, new String[]{"Jess"}, 1998);
-    }
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.graph;
+
+import com.arangodb.async.ArangoCollectionAsync;
+import com.arangodb.async.ArangoCursorAsync;
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.async.ArangoDatabaseAsync;
+import com.arangodb.entity.BaseDocument;
+import com.arangodb.entity.BaseEdgeDocument;
+import com.arangodb.entity.CollectionType;
+import com.arangodb.entity.DocumentCreateEntity;
+import com.arangodb.model.CollectionCreateOptions;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+
+import static org.hamcrest.Matchers.hasItems;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Mark Vollmary
+ * @see <a href="https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html">AQL Example Queries on an
+ * Actors and Movies Database</a>
+ */
+@SuppressWarnings("JavaDoc")
+public class AQLActorsAndMoviesExample {
+
+    private static final String TEST_DB = "actors_movies_test_db";
+    private static ArangoDBAsync arangoDB;
+    private static ArangoDatabaseAsync db;
+
+    @BeforeClass
+    public static void setUp() throws InterruptedException, ExecutionException {
+        arangoDB = new ArangoDBAsync.Builder().build();
+        if (arangoDB.db(TEST_DB).exists().get()) {
+			arangoDB.db(TEST_DB).drop().get();
+		}
+        arangoDB.createDatabase(TEST_DB).get();
+        db = arangoDB.db(TEST_DB);
+        createData();
+    }
+
+    @AfterClass
+    public static void tearDown() throws InterruptedException, ExecutionException {
+        db.drop().get();
+        arangoDB.shutdown();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-movie1-or-movie2">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void allActorsActsInMovie1or2() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
+                "WITH actors FOR x IN ANY 'movies/TheMatrix' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN x._id",
+                null, null, String.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems("actors/Keanu", "actors/Hugo", "actors/Emil", "actors/Carrie", "actors/Laurence"))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-movie1-or-movie2">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void allActorsActsInMovie1or2UnionDistinct() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
+                "WITH actors FOR x IN UNION_DISTINCT ((FOR y IN ANY 'movies/TheMatrix' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id), (FOR y IN ANY 'movies/TheDevilsAdvocate' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id)) RETURN x",
+                null, null, String.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(), hasItems("actors/Emil", "actors/Hugo", "actors/Carrie",
+                "actors/Laurence", "actors/Keanu", "actors/Al", "actors/Charlize"))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-both-movie1-and-movie2-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void allActorsActsInMovie1and2() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
+                "WITH actors FOR x IN INTERSECTION ((FOR y IN ANY 'movies/TheMatrix' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id), (FOR y IN ANY 'movies/TheDevilsAdvocate' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id)) RETURN x",
+                null, null, String.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(), hasItems("actors/Keanu"))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-common-movies-between-actor1-and-actor2-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void allMoviesBetweenActor1andActor2() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
+                "WITH movies FOR x IN INTERSECTION ((FOR y IN ANY 'actors/Hugo' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id), (FOR y IN ANY 'actors/Keanu' actsIn OPTIONS {bfs: true, uniqueVertices: 'global'} RETURN y._id)) RETURN x",
+                null, null, String.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems("movies/TheMatrixRevolutions", "movies/TheMatrixReloaded", "movies/TheMatrix"))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-actors-who-acted-in-3-or-more-movies-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void allActorsWhoActedIn3orMoreMovies() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<Actor>> f = db.query(
+                "FOR x IN actsIn COLLECT actor = x._from WITH COUNT INTO counter FILTER counter >= 3 RETURN {actor: actor, movies: counter}",
+                null, null, Actor.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems(new Actor("actors/Carrie", 3), new Actor("actors/CubaG", 4), new Actor("actors/Hugo", 3),
+                        new Actor("actors/Keanu", 4), new Actor("actors/Laurence", 3), new Actor("actors/MegR", 5),
+                        new Actor("actors/TomC", 3), new Actor("actors/TomH", 3)))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#all-movies-where-exactly-6-actors-acted-in-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void allMoviesWhereExactly6ActorsActedIn() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<String>> f = db.query(
+                "FOR x IN actsIn COLLECT movie = x._to WITH COUNT INTO counter FILTER counter == 6 RETURN movie", null,
+                null, String.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems("movies/SleeplessInSeattle", "movies/TopGun", "movies/YouveGotMail"))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#the-number-of-actors-by-movie-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void theNumberOfActorsByMovie() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<Movie>> f = db.query(
+                "FOR x IN actsIn COLLECT movie = x._to WITH COUNT INTO counter RETURN {movie: movie, actors: counter}",
+                null, null, Movie.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems(new Movie("movies/AFewGoodMen", 11), new Movie("movies/AsGoodAsItGets", 4),
+                        new Movie("movies/JerryMaguire", 9), new Movie("movies/JoeVersustheVolcano", 3),
+                        new Movie("movies/SleeplessInSeattle", 6), new Movie("movies/SnowFallingonCedars", 4),
+                        new Movie("movies/StandByMe", 7), new Movie("movies/TheDevilsAdvocate", 3),
+                        new Movie("movies/TheMatrix", 5), new Movie("movies/TheMatrixReloaded", 4),
+                        new Movie("movies/TheMatrixRevolutions", 4), new Movie("movies/TopGun", 6),
+                        new Movie("movies/WhatDreamsMayCome", 5), new Movie("movies/WhenHarryMetSally", 4),
+                        new Movie("movies/YouveGotMail", 6)))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#the-number-of-movies-by-actor-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void theNumberOfMoviesByActor() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<Actor>> f = db.query(
+                "FOR x IN actsIn COLLECT actor = x._from WITH COUNT INTO counter RETURN {actor: actor, movies: counter}",
+                null, null, Actor.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems(new Actor("actors/Al", 1), new Actor("actors/AnnabellaS", 1), new Actor("actors/AnthonyE", 1),
+                        new Actor("actors/BillPull", 1), new Actor("actors/BillyC", 1), new Actor("actors/BonnieH", 1),
+                        new Actor("actors/BrunoK", 1), new Actor("actors/Carrie", 3), new Actor("actors/CarrieF", 1),
+                        new Actor("actors/Charlize", 1), new Actor("actors/ChristopherG", 1), new Actor("actors/CoreyF", 1),
+                        new Actor("actors/CubaG", 4), new Actor("actors/DaveC", 1), new Actor("actors/DemiM", 1),
+                        new Actor("actors/Emil", 1), new Actor("actors/EthanH", 1), new Actor("actors/GregK", 2),
+                        new Actor("actors/HelenH", 1), new Actor("actors/Hugo", 3), new Actor("actors/JackN", 2),
+                        new Actor("actors/JamesC", 1), new Actor("actors/JamesM", 1), new Actor("actors/JayM", 1),
+                        new Actor("actors/JerryO", 2), new Actor("actors/JohnC", 1), new Actor("actors/JonathanL", 1),
+                        new Actor("actors/JTW", 1), new Actor("actors/Keanu", 4), new Actor("actors/KellyM", 1),
+                        new Actor("actors/KellyP", 1), new Actor("actors/KevinB", 1), new Actor("actors/KevinP", 1),
+                        new Actor("actors/KieferS", 2), new Actor("actors/Laurence", 3), new Actor("actors/MarshallB", 1),
+                        new Actor("actors/MaxS", 2), new Actor("actors/MegR", 5), new Actor("actors/Nathan", 1),
+                        new Actor("actors/NoahW", 1), new Actor("actors/ParkerP", 1), new Actor("actors/ReginaK", 1),
+                        new Actor("actors/ReneeZ", 1), new Actor("actors/RickY", 1), new Actor("actors/RitaW", 1),
+                        new Actor("actors/RiverP", 1), new Actor("actors/Robin", 1), new Actor("actors/RosieO", 1),
+                        new Actor("actors/SteveZ", 1), new Actor("actors/TomC", 3), new Actor("actors/TomH", 3),
+                        new Actor("actors/TomS", 1), new Actor("actors/ValK", 1), new Actor("actors/VictorG", 1),
+                        new Actor("actors/WernerH", 1), new Actor("actors/WilW", 1)))).get();
+    }
+
+    /**
+     * @throws ExecutionException
+     * @throws InterruptedException
+     * @see <a href=
+     * "https://docs.arangodb.com/current/cookbook/Graph/ExampleActorsAndMovies.html#the-number-of-movies-acted-in-between-2005-and-2010-by-actor-">AQL
+     * Example Queries on an Actors and Movies Database</a>
+     */
+    @Test
+    public void theNumberOfMoviesActedInBetween2005and2010byActor() throws InterruptedException, ExecutionException {
+        final CompletableFuture<ArangoCursorAsync<Actor>> f = db.query(
+                "FOR x IN actsIn FILTER x.year >= 1990 && x.year <= 1995 COLLECT actor = x._from WITH COUNT INTO counter RETURN {actor: actor, movies: counter}",
+                null, null, Actor.class);
+        f.whenComplete((cursor, ex) -> assertThat(cursor.asListRemaining(),
+                hasItems(new Actor("actors/BillPull", 1), new Actor("actors/ChristopherG", 1),
+                        new Actor("actors/CubaG", 1), new Actor("actors/DemiM", 1), new Actor("actors/JackN", 1),
+                        new Actor("actors/JamesM", 1), new Actor("actors/JTW", 1), new Actor("actors/KevinB", 1),
+                        new Actor("actors/KieferS", 1), new Actor("actors/MegR", 2), new Actor("actors/Nathan", 1),
+                        new Actor("actors/NoahW", 1), new Actor("actors/RitaW", 1), new Actor("actors/RosieO", 1),
+                        new Actor("actors/TomC", 1), new Actor("actors/TomH", 2), new Actor("actors/VictorG", 1)))).get();
+    }
+
+    @SuppressWarnings("WeakerAccess")
+    public static class Actor {
+        private String actor;
+        private Integer movies;
+
+        public Actor() {
+            super();
+        }
+
+        public Actor(final String actor, final Integer movies) {
+            super();
+            this.actor = actor;
+            this.movies = movies;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((actor == null) ? 0 : actor.hashCode());
+            result = prime * result + ((movies == null) ? 0 : movies.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(final Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            final Actor other = (Actor) obj;
+            if (actor == null) {
+                if (other.actor != null) {
+                    return false;
+                }
+            } else if (!actor.equals(other.actor)) {
+                return false;
+            }
+            if (movies == null) {
+                return other.movies == null;
+            } else return movies.equals(other.movies);
+        }
+
+    }
+
+    @SuppressWarnings("WeakerAccess")
+    public static class Movie {
+        private String movie;
+        private Integer actors;
+
+        public Movie() {
+            super();
+        }
+
+        public Movie(final String movie, final Integer actors) {
+            super();
+            this.movie = movie;
+            this.actors = actors;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((actors == null) ? 0 : actors.hashCode());
+            result = prime * result + ((movie == null) ? 0 : movie.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(final Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            final Movie other = (Movie) obj;
+            if (actors == null) {
+                if (other.actors != null) {
+                    return false;
+                }
+            } else if (!actors.equals(other.actors)) {
+                return false;
+            }
+            if (movie == null) {
+                return other.movie == null;
+            } else return movie.equals(other.movie);
+        }
+
+    }
+
+    private static DocumentCreateEntity<BaseDocument> saveMovie(
+            final ArangoCollectionAsync movies,
+            final String key,
+            final String title,
+            final int released,
+            final String tagline) throws InterruptedException, ExecutionException {
+        final BaseDocument value = new BaseDocument();
+        value.setKey(key);
+        value.addAttribute("title", title);
+        value.addAttribute("released", released);
+        value.addAttribute("tagline", tagline);
+        return movies.insertDocument(value).get();
+    }
+
+    private static DocumentCreateEntity<BaseDocument> saveActor(
+            final ArangoCollectionAsync actors,
+            final String key,
+            final String name,
+            final int born) throws InterruptedException, ExecutionException {
+        final BaseDocument value = new BaseDocument();
+        value.setKey(key);
+        value.addAttribute("name", name);
+        value.addAttribute("born", born);
+        return actors.insertDocument(value).get();
+    }
+
+    private static void saveActsIn(
+            final ArangoCollectionAsync actsIn,
+            final String actor,
+            final String movie,
+            final String[] roles,
+            final int year) throws InterruptedException, ExecutionException {
+        final BaseEdgeDocument value = new BaseEdgeDocument();
+        value.setFrom(actor);
+        value.setTo(movie);
+        value.addAttribute("roles", roles);
+        value.addAttribute("year", year);
+        actsIn.insertDocument(value).get();
+    }
+
+    private static void createData() throws InterruptedException, ExecutionException {
+        db.createCollection("actors").get();
+        final ArangoCollectionAsync actors = db.collection("actors");
+        db.createCollection("movies").get();
+        final ArangoCollectionAsync movies = db.collection("movies");
+        db.createCollection("actsIn", new CollectionCreateOptions().type(CollectionType.EDGES)).get();
+        final ArangoCollectionAsync actsIn = db.collection("actsIn");
+
+        final String theMatrix = saveMovie(movies, "TheMatrix", "The Matrix", 1999, "Welcome to the Real World")
+                .getId();
+        final String keanu = saveActor(actors, "Keanu", "Keanu Reeves", 1964).getId();
+        final String carrie = saveActor(actors, "Carrie", "Carrie-Anne Moss", 1967).getId();
+        final String laurence = saveActor(actors, "Laurence", "Laurence Fishburne", 1961).getId();
+        final String hugo = saveActor(actors, "Hugo", "Hugo Weaving", 1960).getId();
+        final String emil = saveActor(actors, "Emil", "Emil Eifrem", 1978).getId();
+
+        saveActsIn(actsIn, keanu, theMatrix, new String[]{"Neo"}, 1999);
+        saveActsIn(actsIn, carrie, theMatrix, new String[]{"Trinity"}, 1999);
+        saveActsIn(actsIn, laurence, theMatrix, new String[]{"Morpheus"}, 1999);
+        saveActsIn(actsIn, hugo, theMatrix, new String[]{"Agent Smith"}, 1999);
+        saveActsIn(actsIn, emil, theMatrix, new String[]{"Emil"}, 1999);
+
+        final String theMatrixReloaded = saveMovie(movies, "TheMatrixReloaded", "The Matrix Reloaded", 2003,
+                "Free your mind").getId();
+        saveActsIn(actsIn, keanu, theMatrixReloaded, new String[]{"Neo"}, 2003);
+        saveActsIn(actsIn, carrie, theMatrixReloaded, new String[]{"Trinity"}, 2003);
+        saveActsIn(actsIn, laurence, theMatrixReloaded, new String[]{"Morpheus"}, 2003);
+        saveActsIn(actsIn, hugo, theMatrixReloaded, new String[]{"Agent Smith"}, 2003);
+
+        final String theMatrixRevolutions = saveMovie(movies, "TheMatrixRevolutions", "The Matrix Revolutions", 2003,
+                "Everything that has a beginning has an end").getId();
+        saveActsIn(actsIn, keanu, theMatrixRevolutions, new String[]{"Neo"}, 2003);
+        saveActsIn(actsIn, carrie, theMatrixRevolutions, new String[]{"Trinity"}, 2003);
+        saveActsIn(actsIn, laurence, theMatrixRevolutions, new String[]{"Morpheus"}, 2003);
+        saveActsIn(actsIn, hugo, theMatrixRevolutions, new String[]{"Agent Smith"}, 2003);
+
+        final String theDevilsAdvocate = saveMovie(movies, "TheDevilsAdvocate", "The Devil's Advocate", 1997,
+                "Evil has its winning ways").getId();
+        final String charlize = saveActor(actors, "Charlize", "Charlize Theron", 1975).getId();
+        final String al = saveActor(actors, "Al", "Al Pacino", 1940).getId();
+        saveActsIn(actsIn, keanu, theDevilsAdvocate, new String[]{"Kevin Lomax"}, 1997);
+        saveActsIn(actsIn, charlize, theDevilsAdvocate, new String[]{"Mary Ann Lomax"}, 1997);
+        saveActsIn(actsIn, al, theDevilsAdvocate, new String[]{"John Milton"}, 1997);
+
+        final String AFewGoodMen = saveMovie(movies, "AFewGoodMen", "A Few Good Men", 1992,
+                "In the heart of the nation's capital, in a courthouse of the U.S. government, one man will stop at nothing to keep his honor, and one will stop at nothing to find the truth.")
+                .getId();
+        final String tomC = saveActor(actors, "TomC", "Tom Cruise", 1962).getId();
+        final String jackN = saveActor(actors, "JackN", "Jack Nicholson", 1937).getId();
+        final String demiM = saveActor(actors, "DemiM", "Demi Moore", 1962).getId();
+        final String kevinB = saveActor(actors, "KevinB", "Kevin Bacon", 1958).getId();
+        final String kieferS = saveActor(actors, "KieferS", "Kiefer Sutherland", 1966).getId();
+        final String noahW = saveActor(actors, "NoahW", "Noah Wyle", 1971).getId();
+        final String cubaG = saveActor(actors, "CubaG", "Cuba Gooding Jr.", 1968).getId();
+        final String kevinP = saveActor(actors, "KevinP", "Kevin Pollak", 1957).getId();
+        final String jTW = saveActor(actors, "JTW", "J.T. Walsh", 1943).getId();
+        final String jamesM = saveActor(actors, "JamesM", "James Marshall", 1967).getId();
+        final String christopherG = saveActor(actors, "ChristopherG", "Christopher Guest", 1948).getId();
+        saveActsIn(actsIn, tomC, AFewGoodMen, new String[]{"Lt. Daniel Kaffee"}, 1992);
+        saveActsIn(actsIn, jackN, AFewGoodMen, new String[]{"Col. Nathan R. Jessup"}, 1992);
+        saveActsIn(actsIn, demiM, AFewGoodMen, new String[]{"Lt. Cdr. JoAnne Galloway"}, 1992);
+        saveActsIn(actsIn, kevinB, AFewGoodMen, new String[]{"Capt. Jack Ross"}, 1992);
+        saveActsIn(actsIn, kieferS, AFewGoodMen, new String[]{"Lt. Jonathan Kendrick"}, 1992);
+        saveActsIn(actsIn, noahW, AFewGoodMen, new String[]{"Cpl. Jeffrey Barnes"}, 1992);
+        saveActsIn(actsIn, cubaG, AFewGoodMen, new String[]{"Cpl. Carl Hammaker"}, 1992);
+        saveActsIn(actsIn, kevinP, AFewGoodMen, new String[]{"Lt. Sam Weinberg"}, 1992);
+        saveActsIn(actsIn, jTW, AFewGoodMen, new String[]{"Lt. Col. Matthew Andrew Markinson"}, 1992);
+        saveActsIn(actsIn, jamesM, AFewGoodMen, new String[]{"Pfc. Louden Downey"}, 1992);
+        saveActsIn(actsIn, christopherG, AFewGoodMen, new String[]{"Dr. Stone"}, 1992);
+
+        final String topGun = saveMovie(movies, "TopGun", "Top Gun", 1986, "I feel the need, the need for speed.")
+                .getId();
+        final String kellyM = saveActor(actors, "KellyM", "Kelly McGillis", 1957).getId();
+        final String valK = saveActor(actors, "ValK", "Val Kilmer", 1959).getId();
+        final String anthonyE = saveActor(actors, "AnthonyE", "Anthony Edwards", 1962).getId();
+        final String tomS = saveActor(actors, "TomS", "Tom Skerritt", 1933).getId();
+        final String megR = saveActor(actors, "MegR", "Meg Ryan", 1961).getId();
+        saveActsIn(actsIn, tomC, topGun, new String[]{"Maverick"}, 1986);
+        saveActsIn(actsIn, kellyM, topGun, new String[]{"Charlie"}, 1986);
+        saveActsIn(actsIn, valK, topGun, new String[]{"Iceman"}, 1986);
+        saveActsIn(actsIn, anthonyE, topGun, new String[]{"Goose"}, 1986);
+        saveActsIn(actsIn, tomS, topGun, new String[]{"Viper"}, 1986);
+        saveActsIn(actsIn, megR, topGun, new String[]{"Carole"}, 1986);
+
+        final String jerryMaguire = saveMovie(movies, "JerryMaguire", "Jerry Maguire", 2000,
+                "The rest of his life begins now.").getId();
+        final String reneeZ = saveActor(actors, "ReneeZ", "Renee Zellweger", 1969).getId();
+        final String kellyP = saveActor(actors, "KellyP", "Kelly Preston", 1962).getId();
+        final String jerryO = saveActor(actors, "JerryO", "Jerry O'Connell", 1974).getId();
+        final String jayM = saveActor(actors, "JayM", "Jay Mohr", 1970).getId();
+        final String bonnieH = saveActor(actors, "BonnieH", "Bonnie Hunt", 1961).getId();
+        final String reginaK = saveActor(actors, "ReginaK", "Regina King", 1971).getId();
+        final String jonathanL = saveActor(actors, "JonathanL", "Jonathan Lipnicki", 1996).getId();
+        saveActsIn(actsIn, tomC, jerryMaguire, new String[]{"Jerry Maguire"}, 2000);
+        saveActsIn(actsIn, cubaG, jerryMaguire, new String[]{"Rod Tidwell"}, 2000);
+        saveActsIn(actsIn, reneeZ, jerryMaguire, new String[]{"Dorothy Boyd"}, 2000);
+        saveActsIn(actsIn, kellyP, jerryMaguire, new String[]{"Avery Bishop"}, 2000);
+        saveActsIn(actsIn, jerryO, jerryMaguire, new String[]{"Frank Cushman"}, 2000);
+        saveActsIn(actsIn, jayM, jerryMaguire, new String[]{"Bob Sugar"}, 2000);
+        saveActsIn(actsIn, bonnieH, jerryMaguire, new String[]{"Laurel Boyd"}, 2000);
+        saveActsIn(actsIn, reginaK, jerryMaguire, new String[]{"Marcee Tidwell"}, 2000);
+        saveActsIn(actsIn, jonathanL, jerryMaguire, new String[]{"Ray Boyd"}, 2000);
+
+        final String standByMe = saveMovie(movies, "StandByMe", "Stand By Me", 1986,
+                "For some, it's the last real taste of innocence, and the first real taste of life. But for everyone, it's the time that memories are made of.")
+                .getId();
+        final String riverP = saveActor(actors, "RiverP", "River Phoenix", 1970).getId();
+        final String coreyF = saveActor(actors, "CoreyF", "Corey Feldman", 1971).getId();
+        final String wilW = saveActor(actors, "WilW", "Wil Wheaton", 1972).getId();
+        final String johnC = saveActor(actors, "JohnC", "John Cusack", 1966).getId();
+        final String marshallB = saveActor(actors, "MarshallB", "Marshall Bell", 1942).getId();
+        saveActsIn(actsIn, wilW, standByMe, new String[]{"Gordie Lachance"}, 1986);
+        saveActsIn(actsIn, riverP, standByMe, new String[]{"Chris Chambers"}, 1986);
+        saveActsIn(actsIn, jerryO, standByMe, new String[]{"Vern Tessio"}, 1986);
+        saveActsIn(actsIn, coreyF, standByMe, new String[]{"Teddy Duchamp"}, 1986);
+        saveActsIn(actsIn, johnC, standByMe, new String[]{"Denny Lachance"}, 1986);
+        saveActsIn(actsIn, kieferS, standByMe, new String[]{"Ace Merrill"}, 1986);
+        saveActsIn(actsIn, marshallB, standByMe, new String[]{"Mr. Lachance"}, 1986);
+
+        final String asGoodAsItGets = saveMovie(movies, "AsGoodAsItGets", "As Good as It Gets", 1997,
+                "A comedy from the heart that goes for the throat.").getId();
+        final String helenH = saveActor(actors, "HelenH", "Helen Hunt", 1963).getId();
+        final String gregK = saveActor(actors, "GregK", "Greg Kinnear", 1963).getId();
+        saveActsIn(actsIn, jackN, asGoodAsItGets, new String[]{"Melvin Udall"}, 1997);
+        saveActsIn(actsIn, helenH, asGoodAsItGets, new String[]{"Carol Connelly"}, 1997);
+        saveActsIn(actsIn, gregK, asGoodAsItGets, new String[]{"Simon Bishop"}, 1997);
+        saveActsIn(actsIn, cubaG, asGoodAsItGets, new String[]{"Frank Sachs"}, 1997);
+
+        final String whatDreamsMayCome = saveMovie(movies, "WhatDreamsMayCome", "What Dreams May Come", 1998,
+                "After life there is more. The end is just the beginning.").getId();
+        final String annabellaS = saveActor(actors, "AnnabellaS", "Annabella Sciorra", 1960).getId();
+        final String maxS = saveActor(actors, "MaxS", "Max von Sydow", 1929).getId();
+        final String wernerH = saveActor(actors, "WernerH", "Werner Herzog", 1942).getId();
+        final String robin = saveActor(actors, "Robin", "Robin Williams", 1951).getId();
+        saveActsIn(actsIn, robin, whatDreamsMayCome, new String[]{"Chris Nielsen"}, 1998);
+        saveActsIn(actsIn, cubaG, whatDreamsMayCome, new String[]{"Albert Lewis"}, 1998);
+        saveActsIn(actsIn, annabellaS, whatDreamsMayCome, new String[]{"Annie Collins-Nielsen"}, 1998);
+        saveActsIn(actsIn, maxS, whatDreamsMayCome, new String[]{"The Tracker"}, 1998);
+        saveActsIn(actsIn, wernerH, whatDreamsMayCome, new String[]{"The Face"}, 1998);
+
+        final String snowFallingonCedars = saveMovie(movies, "SnowFallingonCedars", "Snow Falling on Cedars", 1999,
+                "First loves last. Forever.").getId();
+        final String ethanH = saveActor(actors, "EthanH", "Ethan Hawke", 1970).getId();
+        final String rickY = saveActor(actors, "RickY", "Rick Yune", 1971).getId();
+        final String jamesC = saveActor(actors, "JamesC", "James Cromwell", 1940).getId();
+        saveActsIn(actsIn, ethanH, snowFallingonCedars, new String[]{"Ishmael Chambers"}, 1999);
+        saveActsIn(actsIn, rickY, snowFallingonCedars, new String[]{"Kazuo Miyamoto"}, 1999);
+        saveActsIn(actsIn, maxS, snowFallingonCedars, new String[]{"Nels Gudmundsson"}, 1999);
+        saveActsIn(actsIn, jamesC, snowFallingonCedars, new String[]{"Judge Fielding"}, 1999);
+
+        final String youveGotMail = saveMovie(movies, "YouveGotMail", "You've Got Mail", 1998,
+                "At odds in life... in love on-line.").getId();
+        final String parkerP = saveActor(actors, "ParkerP", "Parker Posey", 1968).getId();
+        final String daveC = saveActor(actors, "DaveC", "Dave Chappelle", 1973).getId();
+        final String steveZ = saveActor(actors, "SteveZ", "Steve Zahn", 1967).getId();
+        final String tomH = saveActor(actors, "TomH", "Tom Hanks", 1956).getId();
+        saveActsIn(actsIn, tomH, youveGotMail, new String[]{"Joe Fox"}, 1998);
+        saveActsIn(actsIn, megR, youveGotMail, new String[]{"Kathleen Kelly"}, 1998);
+        saveActsIn(actsIn, gregK, youveGotMail, new String[]{"Frank Navasky"}, 1998);
+        saveActsIn(actsIn, parkerP, youveGotMail, new String[]{"Patricia Eden"}, 1998);
+        saveActsIn(actsIn, daveC, youveGotMail, new String[]{"Kevin Jackson"}, 1998);
+        saveActsIn(actsIn, steveZ, youveGotMail, new String[]{"George Pappas"}, 1998);
+
+        final String sleeplessInSeattle = saveMovie(movies, "SleeplessInSeattle", "Sleepless in Seattle", 1993,
+                "What if someone you never met, someone you never saw, someone you never knew was the only someone for you?")
+                .getId();
+        final String ritaW = saveActor(actors, "RitaW", "Rita Wilson", 1956).getId();
+        final String billPull = saveActor(actors, "BillPull", "Bill Pullman", 1953).getId();
+        final String victorG = saveActor(actors, "VictorG", "Victor Garber", 1949).getId();
+        final String rosieO = saveActor(actors, "RosieO", "Rosie O'Donnell", 1962).getId();
+        saveActsIn(actsIn, tomH, sleeplessInSeattle, new String[]{"Sam Baldwin"}, 1993);
+        saveActsIn(actsIn, megR, sleeplessInSeattle, new String[]{"Annie Reed"}, 1993);
+        saveActsIn(actsIn, ritaW, sleeplessInSeattle, new String[]{"Suzy"}, 1993);
+        saveActsIn(actsIn, billPull, sleeplessInSeattle, new String[]{"Walter"}, 1993);
+        saveActsIn(actsIn, victorG, sleeplessInSeattle, new String[]{"Greg"}, 1993);
+        saveActsIn(actsIn, rosieO, sleeplessInSeattle, new String[]{"Becky"}, 1993);
+
+        final String joeVersustheVolcano = saveMovie(movies, "JoeVersustheVolcano", "Joe Versus the Volcano", 1990,
+                "A story of love, lava and burning desire.").getId();
+        final String nathan = saveActor(actors, "Nathan", "Nathan Lane", 1956).getId();
+        saveActsIn(actsIn, tomH, joeVersustheVolcano, new String[]{"Joe Banks"}, 1990);
+        saveActsIn(actsIn, megR, joeVersustheVolcano,
+                new String[]{"DeDe', 'Angelica Graynamore', 'Patricia Graynamore"}, 1990);
+        saveActsIn(actsIn, nathan, joeVersustheVolcano, new String[]{"Baw"}, 1990);
+
+        final String whenHarryMetSally = saveMovie(movies, "WhenHarryMetSally", "When Harry Met Sally", 1998,
+                "At odds in life... in love on-line.").getId();
+        final String billyC = saveActor(actors, "BillyC", "Billy Crystal", 1948).getId();
+        final String carrieF = saveActor(actors, "CarrieF", "Carrie Fisher", 1956).getId();
+        final String brunoK = saveActor(actors, "BrunoK", "Bruno Kirby", 1949).getId();
+        saveActsIn(actsIn, billyC, whenHarryMetSally, new String[]{"Harry Burns"}, 1998);
+        saveActsIn(actsIn, megR, whenHarryMetSally, new String[]{"Sally Albright"}, 1998);
+        saveActsIn(actsIn, carrieF, whenHarryMetSally, new String[]{"Marie"}, 1998);
+        saveActsIn(actsIn, brunoK, whenHarryMetSally, new String[]{"Jess"}, 1998);
+    }
+
+}
diff --git a/src/test/java/com/arangodb/example/graph/BaseGraphTest.java b/src/test/java/com/arangodb/async/example/graph/BaseGraphTest.java
similarity index 95%
rename from src/test/java/com/arangodb/example/graph/BaseGraphTest.java
rename to src/test/java/com/arangodb/async/example/graph/BaseGraphTest.java
index e82d1b8..e5b229c 100644
--- a/src/test/java/com/arangodb/example/graph/BaseGraphTest.java
+++ b/src/test/java/com/arangodb/async/example/graph/BaseGraphTest.java
@@ -1,113 +1,112 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.graph;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.concurrent.ExecutionException;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-
-import com.arangodb.ArangoDBAsync;
-import com.arangodb.ArangoDatabaseAsync;
-import com.arangodb.entity.EdgeDefinition;
-import com.arangodb.entity.VertexEntity;
-
-/**
- * @author Mark Vollmary
- */
-public abstract class BaseGraphTest {
-
-    private static final String TEST_DB = "java_driver_graph_test_db";
-    private static ArangoDBAsync arangoDB;
-    static ArangoDatabaseAsync db;
-    private static final String GRAPH_NAME = "traversalGraph";
-    private static final String EDGE_COLLECTION_NAME = "edges";
-    private static final String VERTEXT_COLLECTION_NAME = "circles";
-
-    @BeforeClass
-    public static void init() throws InterruptedException, ExecutionException {
-        if (arangoDB == null) {
-            arangoDB = new ArangoDBAsync.Builder().build();
-        }
-        if (arangoDB.db(TEST_DB).exists().get()) {
-            arangoDB.db(TEST_DB).drop().get();
-        }
-        arangoDB.createDatabase(TEST_DB).get();
-        BaseGraphTest.db = arangoDB.db(TEST_DB);
-
-        final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<>();
-        final EdgeDefinition edgeDefinition = new EdgeDefinition().collection(EDGE_COLLECTION_NAME)
-                .from(VERTEXT_COLLECTION_NAME).to(VERTEXT_COLLECTION_NAME);
-        edgeDefinitions.add(edgeDefinition);
-        db.createGraph(GRAPH_NAME, edgeDefinitions, null).get();
-        addExampleElements();
-    }
-
-    @AfterClass
-    public static void shutdown() throws InterruptedException, ExecutionException {
-        arangoDB.db(TEST_DB).drop().get();
-        arangoDB.shutdown();
-        arangoDB = null;
-    }
-
-    private static void addExampleElements() throws InterruptedException, ExecutionException {
-
-        // Add circle circles
-        final VertexEntity vA = createVertex(new Circle("A", "1"));
-        final VertexEntity vB = createVertex(new Circle("B", "2"));
-        final VertexEntity vC = createVertex(new Circle("C", "3"));
-        final VertexEntity vD = createVertex(new Circle("D", "4"));
-        final VertexEntity vE = createVertex(new Circle("E", "5"));
-        final VertexEntity vF = createVertex(new Circle("F", "6"));
-        final VertexEntity vG = createVertex(new Circle("G", "7"));
-        final VertexEntity vH = createVertex(new Circle("H", "8"));
-        final VertexEntity vI = createVertex(new Circle("I", "9"));
-        final VertexEntity vJ = createVertex(new Circle("J", "10"));
-        final VertexEntity vK = createVertex(new Circle("K", "11"));
-
-        // Add relevant edges - left branch:
-        saveEdge(new CircleEdge(vA.getId(), vB.getId(), false, true, "left_bar"));
-        saveEdge(new CircleEdge(vB.getId(), vC.getId(), false, true, "left_blarg"));
-        saveEdge(new CircleEdge(vC.getId(), vD.getId(), false, true, "left_blorg"));
-        saveEdge(new CircleEdge(vB.getId(), vE.getId(), false, true, "left_blub"));
-        saveEdge(new CircleEdge(vE.getId(), vF.getId(), false, true, "left_schubi"));
-
-        // Add relevant edges - right branch:
-        saveEdge(new CircleEdge(vA.getId(), vG.getId(), false, true, "right_foo"));
-        saveEdge(new CircleEdge(vG.getId(), vH.getId(), false, true, "right_blob"));
-        saveEdge(new CircleEdge(vH.getId(), vI.getId(), false, true, "right_blub"));
-        saveEdge(new CircleEdge(vG.getId(), vJ.getId(), false, true, "right_zip"));
-        saveEdge(new CircleEdge(vJ.getId(), vK.getId(), false, true, "right_zup"));
-    }
-
-    private static void saveEdge(final CircleEdge edge)
-            throws InterruptedException, ExecutionException {
-        db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(edge).get();
-    }
-
-    private static VertexEntity createVertex(final Circle vertex)
-            throws InterruptedException, ExecutionException {
-        return db.graph(GRAPH_NAME).vertexCollection(VERTEXT_COLLECTION_NAME).insertVertex(vertex).get();
-    }
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.graph;
+
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.async.ArangoDatabaseAsync;
+import com.arangodb.entity.EdgeDefinition;
+import com.arangodb.entity.VertexEntity;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * @author Mark Vollmary
+ */
+public abstract class BaseGraphTest {
+
+    private static final String TEST_DB = "java_driver_graph_test_db";
+    private static ArangoDBAsync arangoDB;
+    static ArangoDatabaseAsync db;
+    private static final String GRAPH_NAME = "traversalGraph";
+    private static final String EDGE_COLLECTION_NAME = "edges";
+    private static final String VERTEXT_COLLECTION_NAME = "circles";
+
+    @BeforeClass
+    public static void init() throws InterruptedException, ExecutionException {
+        if (arangoDB == null) {
+            arangoDB = new ArangoDBAsync.Builder().build();
+        }
+        if (arangoDB.db(TEST_DB).exists().get()) {
+            arangoDB.db(TEST_DB).drop().get();
+        }
+        arangoDB.createDatabase(TEST_DB).get();
+        BaseGraphTest.db = arangoDB.db(TEST_DB);
+
+        final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<>();
+        final EdgeDefinition edgeDefinition = new EdgeDefinition().collection(EDGE_COLLECTION_NAME)
+                .from(VERTEXT_COLLECTION_NAME).to(VERTEXT_COLLECTION_NAME);
+        edgeDefinitions.add(edgeDefinition);
+        db.createGraph(GRAPH_NAME, edgeDefinitions, null).get();
+        addExampleElements();
+    }
+
+    @AfterClass
+    public static void shutdown() throws InterruptedException, ExecutionException {
+        arangoDB.db(TEST_DB).drop().get();
+        arangoDB.shutdown();
+        arangoDB = null;
+    }
+
+    private static void addExampleElements() throws InterruptedException, ExecutionException {
+
+        // Add circle circles
+        final VertexEntity vA = createVertex(new Circle("A", "1"));
+        final VertexEntity vB = createVertex(new Circle("B", "2"));
+        final VertexEntity vC = createVertex(new Circle("C", "3"));
+        final VertexEntity vD = createVertex(new Circle("D", "4"));
+        final VertexEntity vE = createVertex(new Circle("E", "5"));
+        final VertexEntity vF = createVertex(new Circle("F", "6"));
+        final VertexEntity vG = createVertex(new Circle("G", "7"));
+        final VertexEntity vH = createVertex(new Circle("H", "8"));
+        final VertexEntity vI = createVertex(new Circle("I", "9"));
+        final VertexEntity vJ = createVertex(new Circle("J", "10"));
+        final VertexEntity vK = createVertex(new Circle("K", "11"));
+
+        // Add relevant edges - left branch:
+        saveEdge(new CircleEdge(vA.getId(), vB.getId(), false, true, "left_bar"));
+        saveEdge(new CircleEdge(vB.getId(), vC.getId(), false, true, "left_blarg"));
+        saveEdge(new CircleEdge(vC.getId(), vD.getId(), false, true, "left_blorg"));
+        saveEdge(new CircleEdge(vB.getId(), vE.getId(), false, true, "left_blub"));
+        saveEdge(new CircleEdge(vE.getId(), vF.getId(), false, true, "left_schubi"));
+
+        // Add relevant edges - right branch:
+        saveEdge(new CircleEdge(vA.getId(), vG.getId(), false, true, "right_foo"));
+        saveEdge(new CircleEdge(vG.getId(), vH.getId(), false, true, "right_blob"));
+        saveEdge(new CircleEdge(vH.getId(), vI.getId(), false, true, "right_blub"));
+        saveEdge(new CircleEdge(vG.getId(), vJ.getId(), false, true, "right_zip"));
+        saveEdge(new CircleEdge(vJ.getId(), vK.getId(), false, true, "right_zup"));
+    }
+
+    private static void saveEdge(final CircleEdge edge)
+            throws InterruptedException, ExecutionException {
+        db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(edge).get();
+    }
+
+    private static VertexEntity createVertex(final Circle vertex)
+            throws InterruptedException, ExecutionException {
+        return db.graph(GRAPH_NAME).vertexCollection(VERTEXT_COLLECTION_NAME).insertVertex(vertex).get();
+    }
+
+}
diff --git a/src/test/java/com/arangodb/example/graph/Circle.java b/src/test/java/com/arangodb/async/example/graph/Circle.java
similarity index 97%
rename from src/test/java/com/arangodb/example/graph/Circle.java
rename to src/test/java/com/arangodb/async/example/graph/Circle.java
index 72b5dd6..3cc4c84 100644
--- a/src/test/java/com/arangodb/example/graph/Circle.java
+++ b/src/test/java/com/arangodb/async/example/graph/Circle.java
@@ -18,7 +18,7 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.example.graph;
+package com.arangodb.async.example.graph;
 
 import com.arangodb.entity.DocumentField;
 import com.arangodb.entity.DocumentField.Type;
diff --git a/src/test/java/com/arangodb/example/graph/CircleEdge.java b/src/test/java/com/arangodb/async/example/graph/CircleEdge.java
similarity index 98%
rename from src/test/java/com/arangodb/example/graph/CircleEdge.java
rename to src/test/java/com/arangodb/async/example/graph/CircleEdge.java
index 8ebcc7a..3d8a487 100644
--- a/src/test/java/com/arangodb/example/graph/CircleEdge.java
+++ b/src/test/java/com/arangodb/async/example/graph/CircleEdge.java
@@ -18,7 +18,7 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.example.graph;
+package com.arangodb.async.example.graph;
 
 import com.arangodb.entity.DocumentField;
 import com.arangodb.entity.DocumentField.Type;
diff --git a/src/test/java/com/arangodb/example/graph/GraphTraversalsInAQLExample.java b/src/test/java/com/arangodb/async/example/graph/GraphTraversalsInAQLExample.java
similarity index 98%
rename from src/test/java/com/arangodb/example/graph/GraphTraversalsInAQLExample.java
rename to src/test/java/com/arangodb/async/example/graph/GraphTraversalsInAQLExample.java
index 55fa9b7..ed00cc1 100644
--- a/src/test/java/com/arangodb/example/graph/GraphTraversalsInAQLExample.java
+++ b/src/test/java/com/arangodb/async/example/graph/GraphTraversalsInAQLExample.java
@@ -18,18 +18,17 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.example.graph;
+package com.arangodb.async.example.graph;
 
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
+import com.arangodb.async.ArangoCursorAsync;
+import org.junit.Test;
 
 import java.util.Collection;
 import java.util.concurrent.ExecutionException;
 
-import org.junit.Test;
-
-import com.arangodb.ArangoCursorAsync;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
 
 /**
  * Graph traversals in AQL
diff --git a/src/test/java/com/arangodb/example/graph/ShortestPathInAQLExample.java b/src/test/java/com/arangodb/async/example/graph/ShortestPathInAQLExample.java
similarity index 97%
rename from src/test/java/com/arangodb/example/graph/ShortestPathInAQLExample.java
rename to src/test/java/com/arangodb/async/example/graph/ShortestPathInAQLExample.java
index f86ad88..dfe3b21 100644
--- a/src/test/java/com/arangodb/example/graph/ShortestPathInAQLExample.java
+++ b/src/test/java/com/arangodb/async/example/graph/ShortestPathInAQLExample.java
@@ -18,20 +18,19 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.example.graph;
+package com.arangodb.async.example.graph;
 
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
+import com.arangodb.async.ArangoCursorAsync;
+import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 
-import org.junit.Test;
-
-import com.arangodb.ArangoCursorAsync;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
 
 /**
  * Shortest Path in AQL
diff --git a/src/test/java/com/arangodb/example/ssl/SslExample.java b/src/test/java/com/arangodb/async/example/ssl/SslExample.java
similarity index 94%
rename from src/test/java/com/arangodb/example/ssl/SslExample.java
rename to src/test/java/com/arangodb/async/example/ssl/SslExample.java
index 202489f..7dc93eb 100644
--- a/src/test/java/com/arangodb/example/ssl/SslExample.java
+++ b/src/test/java/com/arangodb/async/example/ssl/SslExample.java
@@ -1,79 +1,77 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.ssl;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertThat;
-
-import java.security.KeyStore;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManagerFactory;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import com.arangodb.ArangoDBAsync;
-import com.arangodb.entity.ArangoDBVersion;
-
-/**
- * @author Mark Vollmary
- *
- */
-public class SslExample {
-
-	/*-
-	 * a SSL trust store
-	 * 
-	 * create the trust store for the self signed certificate:
-	 * keytool -import -alias "my arangodb server cert" -file UnitTests/server.pem -keystore example.truststore
-	 * 
-	 * Documentation:
-	 * https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/ssl/SSLSocketFactory.html
-	 */
-	private static final String SSL_TRUSTSTORE = "/example.truststore";
-	private static final String SSL_TRUSTSTORE_PASSWORD = "12345678";
-
-	@Test
-	@Ignore
-	public void connect() throws Exception {
-		final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
-		ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());
-
-		final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
-		kmf.init(ks, SSL_TRUSTSTORE_PASSWORD.toCharArray());
-
-		final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
-		tmf.init(ks);
-
-		final SSLContext sc = SSLContext.getInstance("TLS");
-		sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
-
-		final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
-				.loadProperties(SslExample.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
-				.sslContext(sc).build();
-		final ArangoDBVersion version = arangoDB.getVersion().get();
-		assertThat(version, is(notNullValue()));
-	}
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.ssl;
+
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.entity.ArangoDBVersion;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+import java.security.KeyStore;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Mark Vollmary
+ *
+ */
+public class SslExample {
+
+	/*-
+	 * a SSL trust store
+	 * 
+	 * create the trust store for the self signed certificate:
+	 * keytool -import -alias "my arangodb server cert" -file UnitTests/server.pem -keystore example.truststore
+	 * 
+	 * Documentation:
+	 * https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/ssl/SSLSocketFactory.html
+	 */
+	private static final String SSL_TRUSTSTORE = "/example.truststore";
+	private static final String SSL_TRUSTSTORE_PASSWORD = "12345678";
+
+	@Test
+	@Ignore
+	public void connect() throws Exception {
+		final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+		ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());
+
+		final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+		kmf.init(ks, SSL_TRUSTSTORE_PASSWORD.toCharArray());
+
+		final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+		tmf.init(ks);
+
+		final SSLContext sc = SSLContext.getInstance("TLS");
+		sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+
+		final ArangoDBAsync arangoDB = new ArangoDBAsync.Builder()
+				.loadProperties(SslExample.class.getResourceAsStream("/arangodb-ssl.properties")).useSsl(true)
+				.sslContext(sc).build();
+		final ArangoDBVersion version = arangoDB.getVersion().get();
+		assertThat(version, is(notNullValue()));
+	}
+
+}
diff --git a/src/test/java/com/arangodb/example/velocypack/VPackExample.java b/src/test/java/com/arangodb/async/example/velocypack/VPackExample.java
similarity index 95%
rename from src/test/java/com/arangodb/example/velocypack/VPackExample.java
rename to src/test/java/com/arangodb/async/example/velocypack/VPackExample.java
index b01d711..cb5c786 100644
--- a/src/test/java/com/arangodb/example/velocypack/VPackExample.java
+++ b/src/test/java/com/arangodb/async/example/velocypack/VPackExample.java
@@ -1,115 +1,114 @@
-/*
- * DISCLAIMER
- *
- * Copyright 2016 ArangoDB GmbH, Cologne, Germany
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Copyright holder is ArangoDB GmbH, Cologne, Germany
- */
-
-package com.arangodb.example.velocypack;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.Iterator;
-import java.util.Map.Entry;
-
-import org.junit.Test;
-
-import com.arangodb.velocypack.VPackBuilder;
-import com.arangodb.velocypack.VPackSlice;
-import com.arangodb.velocypack.ValueType;
-import com.arangodb.velocypack.exception.VPackException;
-
-/**
- * @author Mark Vollmary
- *
- */
-public class VPackExample {
-
-	@Test
-	public void buildObject() throws VPackException {
-		final VPackBuilder builder = new VPackBuilder();
-		builder.add(ValueType.OBJECT);// object start
-		builder.add("foo", 1); // add field "foo" with value 1
-		builder.add("bar", 2); // add field "bar" with value 2
-		builder.close();// object end
-
-		final VPackSlice slice = builder.slice(); // create slice
-		assertThat(slice.isObject(), is(true));
-		assertThat(slice.size(), is(2)); // number of fields
-
-		final VPackSlice foo = slice.get("foo"); // get field "foo"
-		assertThat(foo.isInteger(), is(true));
-		assertThat(foo.getAsInt(), is(1));
-
-		final VPackSlice bar = slice.get("bar"); // get field "bar"
-		assertThat(bar.isInteger(), is(true));
-		assertThat(bar.getAsInt(), is(2));
-
-		// iterate over the fields
-		for (final Iterator<Entry<String, VPackSlice>> iterator = slice.objectIterator(); iterator.hasNext();) {
-			final Entry<String, VPackSlice> field = iterator.next();
-			assertThat(field.getValue().isInteger(), is(true));
-		}
-	}
-
-	@Test
-	public void buildArray() throws VPackException {
-		final VPackBuilder builder = new VPackBuilder();
-		builder.add(ValueType.ARRAY); // array start
-		builder.add(1);// add value 1
-		builder.add(2);// add value 2
-		builder.add(3);// add value 3
-		builder.close(); // array end
-
-		final VPackSlice slice = builder.slice();// create slice
-		assertThat(slice.isArray(), is(true));
-		assertThat(slice.size(), is(3));// number of values
-
-		// iterate over values
-		for (int i = 0; i < slice.size(); i++) {
-			final VPackSlice value = slice.get(i);
-			assertThat(value.isInteger(), is(true));
-			assertThat(value.getAsInt(), is(i + 1));
-		}
-
-		// iterate over values with Iterator
-		for (final Iterator<VPackSlice> iterator = slice.arrayIterator(); iterator.hasNext();) {
-			final VPackSlice value = iterator.next();
-			assertThat(value.isInteger(), is(true));
-		}
-	}
-
-	@Test
-	public void buildObjectInObject() throws VPackException {
-		final VPackBuilder builder = new VPackBuilder();
-		builder.add(ValueType.OBJECT);// object start
-		builder.add("foo", ValueType.OBJECT); // add object in field "foo"
-		builder.add("bar", 2); // add field "bar" with value 2 to object "foo"
-		builder.close();// object "foo" end
-		builder.close();// object end
-
-		final VPackSlice slice = builder.slice(); // create slice
-		assertThat(slice.isObject(), is(true));
-
-		final VPackSlice foo = slice.get("foo");
-		assertThat(foo.isObject(), is(true));
-
-		final VPackSlice bar = foo.get("bar"); // get field "bar" from "foo"
-		assertThat(bar.isInteger(), is(true));
-	}
-
-}
+/*
+ * DISCLAIMER
+ *
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
+ */
+
+package com.arangodb.async.example.velocypack;
+
+import com.arangodb.velocypack.VPackBuilder;
+import com.arangodb.velocypack.VPackSlice;
+import com.arangodb.velocypack.ValueType;
+import com.arangodb.velocypack.exception.VPackException;
+import org.junit.Test;
+
+import java.util.Iterator;
+import java.util.Map.Entry;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * @author Mark Vollmary
+ *
+ */
+public class VPackExample {
+
+	@Test
+	public void buildObject() throws VPackException {
+		final VPackBuilder builder = new VPackBuilder();
+		builder.add(ValueType.OBJECT);// object start
+		builder.add("foo", 1); // add field "foo" with value 1
+		builder.add("bar", 2); // add field "bar" with value 2
+		builder.close();// object end
+
+		final VPackSlice slice = builder.slice(); // create slice
+		assertThat(slice.isObject(), is(true));
+		assertThat(slice.size(), is(2)); // number of fields
+
+		final VPackSlice foo = slice.get("foo"); // get field "foo"
+		assertThat(foo.isInteger(), is(true));
+		assertThat(foo.getAsInt(), is(1));
+
+		final VPackSlice bar = slice.get("bar"); // get field "bar"
+		assertThat(bar.isInteger(), is(true));
+		assertThat(bar.getAsInt(), is(2));
+
+		// iterate over the fields
+		for (final Iterator<Entry<String, VPackSlice>> iterator = slice.objectIterator(); iterator.hasNext();) {
+			final Entry<String, VPackSlice> field = iterator.next();
+			assertThat(field.getValue().isInteger(), is(true));
+		}
+	}
+
+	@Test
+	public void buildArray() throws VPackException {
+		final VPackBuilder builder = new VPackBuilder();
+		builder.add(ValueType.ARRAY); // array start
+		builder.add(1);// add value 1
+		builder.add(2);// add value 2
+		builder.add(3);// add value 3
+		builder.close(); // array end
+
+		final VPackSlice slice = builder.slice();// create slice
+		assertThat(slice.isArray(), is(true));
+		assertThat(slice.size(), is(3));// number of values
+
+		// iterate over values
+		for (int i = 0; i < slice.size(); i++) {
+			final VPackSlice value = slice.get(i);
+			assertThat(value.isInteger(), is(true));
+			assertThat(value.getAsInt(), is(i + 1));
+		}
+
+		// iterate over values with Iterator
+		for (final Iterator<VPackSlice> iterator = slice.arrayIterator(); iterator.hasNext();) {
+			final VPackSlice value = iterator.next();
+			assertThat(value.isInteger(), is(true));
+		}
+	}
+
+	@Test
+	public void buildObjectInObject() throws VPackException {
+		final VPackBuilder builder = new VPackBuilder();
+		builder.add(ValueType.OBJECT);// object start
+		builder.add("foo", ValueType.OBJECT); // add object in field "foo"
+		builder.add("bar", 2); // add field "bar" with value 2 to object "foo"
+		builder.close();// object "foo" end
+		builder.close();// object end
+
+		final VPackSlice slice = builder.slice(); // create slice
+		assertThat(slice.isObject(), is(true));
+
+		final VPackSlice foo = slice.get("foo");
+		assertThat(foo.isObject(), is(true));
+
+		final VPackSlice bar = foo.get("bar"); // get field "bar" from "foo"
+		assertThat(bar.isInteger(), is(true));
+	}
+
+}
diff --git a/src/test/java/com/arangodb/serde/CustomSerdeTest.java b/src/test/java/com/arangodb/async/serde/CustomSerdeTest.java
similarity index 96%
rename from src/test/java/com/arangodb/serde/CustomSerdeTest.java
rename to src/test/java/com/arangodb/async/serde/CustomSerdeTest.java
index 6eeeaa9..ae733b3 100644
--- a/src/test/java/com/arangodb/serde/CustomSerdeTest.java
+++ b/src/test/java/com/arangodb/async/serde/CustomSerdeTest.java
@@ -18,10 +18,13 @@
  * Copyright holder is ArangoDB GmbH, Cologne, Germany
  */
 
-package com.arangodb.serde;
+package com.arangodb.async.serde;
 
 
-import com.arangodb.*;
+import com.arangodb.VelocyJack;
+import com.arangodb.async.ArangoCollectionAsync;
+import com.arangodb.async.ArangoDBAsync;
+import com.arangodb.async.ArangoDatabaseAsync;
 import com.arangodb.entity.BaseDocument;
 import com.arangodb.model.DocumentCreateOptions;
 import org.junit.After;

From f932146eae0c0214b4dd365d2d00b59e2d1856c1 Mon Sep 17 00:00:00 2001
From: michele <michele@cheergg.com>
Date: Wed, 4 Sep 2019 14:50:54 +0200
Subject: [PATCH 2/2] code analysis fixes

---
 README.md                                      |  2 +-
 .../arangodb/async/ArangoCollectionAsync.java  | 13 +++----------
 .../java/com/arangodb/async/ArangoDBAsync.java |  7 ++++---
 .../arangodb/async/ArangoDatabaseAsync.java    |  2 +-
 .../async/ArangoEdgeCollectionAsync.java       |  9 +--------
 .../com/arangodb/async/ArangoGraphAsync.java   |  7 ++++---
 .../com/arangodb/async/ArangoRouteAsync.java   |  1 +
 .../async/ArangoVertexCollectionAsync.java     |  9 +--------
 .../com/arangodb/async/ArangoViewAsync.java    |  5 +++--
 .../internal/ArangoCollectionAsyncImpl.java    |  4 ++--
 .../async/internal/ArangoCursorAsyncImpl.java  |  4 ++--
 .../internal/ArangoDatabaseAsyncImpl.java      |  7 ++++---
 .../ArangoEdgeCollectionAsyncImpl.java         |  2 +-
 .../async/internal/ArangoExecutorAsync.java    |  2 +-
 .../async/internal/ArangoGraphAsyncImpl.java   |  9 +++++----
 .../async/internal/ArangoRouteAsyncImpl.java   | 13 +++----------
 .../async/internal/ArangoSearchAsyncImpl.java  |  5 +++--
 .../ArangoVertexCollectionAsyncImpl.java       |  2 +-
 .../async/internal/ArangoViewAsyncImpl.java    |  5 +++--
 .../velocystream/VstConnectionAsync.java       | 18 +++++++-----------
 20 files changed, 51 insertions(+), 75 deletions(-)

diff --git a/README.md b/README.md
index 1599a64..9e094de 100644
--- a/README.md
+++ b/README.md
@@ -21,5 +21,5 @@ The following documentation links to the documentation of the synchronous varian
 
 - [ArangoDB](https://www.arangodb.com/)
 - [ChangeLog](ChangeLog.md)
-- [Examples](src/test/java/com/arangodb/example)
+- [Examples](src/test/java/com/arangodb/async/example)
 - [JavaDoc](http://arangodb.github.io/arangodb-java-driver-async/javadoc-5_1)
diff --git a/src/main/java/com/arangodb/async/ArangoCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java
index ab17217..d3d4ab0 100644
--- a/src/main/java/com/arangodb/async/ArangoCollectionAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java
@@ -35,6 +35,7 @@
  * @see <a href="https://docs.arangodb.com/current/HTTP/Collection/">Documents API Documentation</a>
  * @author Mark Vollmary
  */
+@SuppressWarnings("unused")
 public interface ArangoCollectionAsync extends ArangoSerializationAccessor {
 
 	/**
@@ -42,14 +43,14 @@ public interface ArangoCollectionAsync extends ArangoSerializationAccessor {
 	 * 
 	 * @return database handler
 	 */
-	public ArangoDatabaseAsync db();
+	ArangoDatabaseAsync db();
 
 	/**
 	 * The name of the collection
 	 * 
 	 * @return collection name
 	 */
-	public String name();
+	String name();
 
 	/**
 	 * Creates a new document from the given document, unless there is already a document with the _key given. If no
@@ -338,9 +339,6 @@ <T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> updateDocume
 	 *      Documentation</a>
 	 * @param key
 	 *            The key of the document
-	 * @param type
-	 *            The type of the document (POJO class, VPackSlice or String for Json). Only necessary if
-	 *            options.returnOld is set to true, otherwise can be null.
 	 * @return information about the document
 	 */
 	CompletableFuture<DocumentDeleteEntity<Void>> deleteDocument(final String key);
@@ -372,9 +370,6 @@ <T> CompletableFuture<DocumentDeleteEntity<T>> deleteDocument(
 	 *      Documentation</a>
 	 * @param values
 	 *            The keys of the documents or the documents themselves
-	 * @param type
-	 *            The type of the documents (POJO class, VPackSlice or String for Json). Only necessary if
-	 *            options.returnOld is set to true, otherwise can be null.
 	 * @return information about the documents
 	 */
 	CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<Void>>> deleteDocuments(final Collection<?> values);
@@ -586,8 +581,6 @@ CompletableFuture<IndexEntity> ensureFulltextIndex(
 	 * 
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Collection/Creating.html#create-collection">API
 	 *      Documentation</a>
-	 * @param options
-	 *            Additional options, can be null
 	 * @return information about the collection
 	 */
 	CompletableFuture<CollectionEntity> create();
diff --git a/src/main/java/com/arangodb/async/ArangoDBAsync.java b/src/main/java/com/arangodb/async/ArangoDBAsync.java
index 50960ac..de2cffe 100644
--- a/src/main/java/com/arangodb/async/ArangoDBAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoDBAsync.java
@@ -75,7 +75,8 @@ public interface ArangoDBAsync extends ArangoSerializationAccessor {
 	 * 
 	 * @author Mark Vollmary
 	 */
-	public static class Builder extends InternalArangoDBBuilder {
+	@SuppressWarnings("unused")
+	class Builder extends InternalArangoDBBuilder {
 
 		public Builder() {
 			super();
@@ -483,8 +484,8 @@ public Builder registerJsonModule(final VPackParserModule module) {
 		 *            modules to register
 		 * @return {@link ArangoDBAsync.Builder}
 		 */
-		public Builder registerJsonModules(final VPackParserModule... module) {
-			vpackParserBuilder.registerModules(module);
+		public Builder registerJsonModules(final VPackParserModule... modules) {
+			vpackParserBuilder.registerModules(modules);
 			return this;
 		}
 
diff --git a/src/main/java/com/arangodb/async/ArangoDatabaseAsync.java b/src/main/java/com/arangodb/async/ArangoDatabaseAsync.java
index ddf0e39..c3b3af1 100644
--- a/src/main/java/com/arangodb/async/ArangoDatabaseAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoDatabaseAsync.java
@@ -39,6 +39,7 @@
  * @see <a href="https://docs.arangodb.com/current/HTTP/Database/">Databases API Documentation</a>
  * @see <a href="https://docs.arangodb.com/current/HTTP/AqlQuery/">Query API Documentation</a>
  */
+@SuppressWarnings("unused")
 public interface ArangoDatabaseAsync extends ArangoSerializationAccessor {
 
     /**
@@ -102,7 +103,6 @@ public interface ArangoDatabaseAsync extends ArangoSerializationAccessor {
      * Creates a collection
      *
      * @param name    The name of the collection
-     * @param options Additional options, can be null
      * @return information about the collection
      * @see <a href="https://docs.arangodb.com/current/HTTP/Collection/Creating.html#create-collection">API
      * Documentation</a>
diff --git a/src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java
index d105774..d555356 100644
--- a/src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java
@@ -33,6 +33,7 @@
  * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html">API Documentation</a>
  * @author Mark Vollmary
  */
+@SuppressWarnings("unused")
 public interface ArangoEdgeCollectionAsync extends ArangoSerializationAccessor {
 
 	/**
@@ -104,8 +105,6 @@ public interface ArangoEdgeCollectionAsync extends ArangoSerializationAccessor {
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
 	 * @param key
 	 *            The key of the edge
-	 * @param type
-	 *            The type of the edge-document (POJO class, VPackSlice or String for Json)
 	 * @return information about the edge
 	 */
 	<T> CompletableFuture<EdgeUpdateEntity> replaceEdge(final String key, final T value);
@@ -117,8 +116,6 @@ public interface ArangoEdgeCollectionAsync extends ArangoSerializationAccessor {
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
 	 * @param key
 	 *            The key of the edge
-	 * @param type
-	 *            The type of the edge-document (POJO class, VPackSlice or String for Json)
 	 * @param options
 	 *            Additional options, can be null
 	 * @return information about the edge
@@ -136,8 +133,6 @@ <T> CompletableFuture<EdgeUpdateEntity> replaceEdge(
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
 	 * @param key
 	 *            The key of the edge
-	 * @param type
-	 *            The type of the edge-document (POJO class, VPackSlice or String for Json)
 	 * @return information about the edge
 	 */
 	<T> CompletableFuture<EdgeUpdateEntity> updateEdge(final String key, final T value);
@@ -150,8 +145,6 @@ <T> CompletableFuture<EdgeUpdateEntity> replaceEdge(
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
 	 * @param key
 	 *            The key of the edge
-	 * @param type
-	 *            The type of the edge-document (POJO class, VPackSlice or String for Json)
 	 * @param options
 	 *            Additional options, can be null
 	 * @return information about the edge
diff --git a/src/main/java/com/arangodb/async/ArangoGraphAsync.java b/src/main/java/com/arangodb/async/ArangoGraphAsync.java
index c2a5886..8713ce4 100644
--- a/src/main/java/com/arangodb/async/ArangoGraphAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoGraphAsync.java
@@ -34,6 +34,7 @@
  * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/">API Documentation</a>
  * @author Mark Vollmary
  */
+@SuppressWarnings("unused")
 public interface ArangoGraphAsync extends ArangoSerializationAccessor {
 
 	/**
@@ -41,14 +42,14 @@ public interface ArangoGraphAsync extends ArangoSerializationAccessor {
 	 * 
 	 * @return database handler
 	 */
-	public ArangoDatabaseAsync db();
+	ArangoDatabaseAsync db();
 
 	/**
 	 * The name of the collection
 	 * 
 	 * @return collection name
 	 */
-	public String name();
+	String name();
 
 	/**
 	 * Checks whether the graph exists
@@ -102,7 +103,7 @@ CompletableFuture<GraphEntity> createGraph(
 	 *            graphs.
 	 * @return void
 	 */
-	CompletableFuture<Void> drop(boolean dropCollection);
+	CompletableFuture<Void> drop(boolean dropCollections);
 
 	/**
 	 * Get a graph from the graph module
diff --git a/src/main/java/com/arangodb/async/ArangoRouteAsync.java b/src/main/java/com/arangodb/async/ArangoRouteAsync.java
index cf7d7bc..8877480 100644
--- a/src/main/java/com/arangodb/async/ArangoRouteAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoRouteAsync.java
@@ -31,6 +31,7 @@
  * 
  * @author Mark Vollmary
  */
+@SuppressWarnings("unused")
 public interface ArangoRouteAsync extends ArangoSerializationAccessor {
 
 	/**
diff --git a/src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java
index d542ca0..c8644f3 100644
--- a/src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java
@@ -33,6 +33,7 @@
  * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html">API Documentation</a>
  * @author Mark Vollmary
  */
+@SuppressWarnings("unused")
 public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor {
 
 	/**
@@ -115,8 +116,6 @@ public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor
 	 *      Documentation</a>
 	 * @param key
 	 *            The key of the vertex
-	 * @param type
-	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
 	 * @return information about the vertex
 	 */
 	<T> CompletableFuture<VertexUpdateEntity> replaceVertex(final String key, final T value);
@@ -129,8 +128,6 @@ public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor
 	 *      Documentation</a>
 	 * @param key
 	 *            The key of the vertex
-	 * @param type
-	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
 	 * @param options
 	 *            Additional options, can be null
 	 * @return information about the vertex
@@ -148,8 +145,6 @@ <T> CompletableFuture<VertexUpdateEntity> replaceVertex(
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
 	 * @param key
 	 *            The key of the vertex
-	 * @param type
-	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
 	 * @return information about the vertex
 	 */
 	<T> CompletableFuture<VertexUpdateEntity> updateVertex(final String key, final T value);
@@ -162,8 +157,6 @@ <T> CompletableFuture<VertexUpdateEntity> replaceVertex(
 	 * @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
 	 * @param key
 	 *            The key of the vertex
-	 * @param type
-	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
 	 * @param options
 	 *            Additional options, can be null
 	 * @return information about the vertex
diff --git a/src/main/java/com/arangodb/async/ArangoViewAsync.java b/src/main/java/com/arangodb/async/ArangoViewAsync.java
index 9abee19..e471659 100644
--- a/src/main/java/com/arangodb/async/ArangoViewAsync.java
+++ b/src/main/java/com/arangodb/async/ArangoViewAsync.java
@@ -32,6 +32,7 @@
  * @author Mark Vollmary
  * @since ArangoDB 3.4.0
  */
+@SuppressWarnings("unused")
 public interface ArangoViewAsync extends ArangoSerializationAccessor {
 
 	/**
@@ -39,14 +40,14 @@ public interface ArangoViewAsync extends ArangoSerializationAccessor {
 	 * 
 	 * @return database handler
 	 */
-	public ArangoDatabaseAsync db();
+	ArangoDatabaseAsync db();
 
 	/**
 	 * The name of the view
 	 * 
 	 * @return view name
 	 */
-	public String name();
+	String name();
 
 	/**
 	 * Checks whether the view exists.
diff --git a/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java
index 3dd93e0..a4d25a4 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java
@@ -41,7 +41,7 @@ public class ArangoCollectionAsyncImpl
         extends InternalArangoCollection<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoExecutorAsync>
         implements ArangoCollectionAsync {
 
-    protected ArangoCollectionAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
+    ArangoCollectionAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
         super(db, name);
     }
 
@@ -319,7 +319,7 @@ public CompletableFuture<Collection<IndexEntity>> getIndexes() {
 
     @Override
     public CompletableFuture<Boolean> exists() {
-        return getInfo().thenApply(info -> info != null).exceptionally(e -> e == null);
+        return getInfo().thenApply(Objects::nonNull).exceptionally(Objects::isNull);
     }
 
     @Override
diff --git a/src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java
index 3ae9ec2..71ff0fa 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoCursorAsyncImpl.java
@@ -36,8 +36,8 @@
  */
 public class ArangoCursorAsyncImpl<T> extends ArangoCursorImpl<T> implements ArangoCursorAsync<T> {
 
-	protected ArangoCursorAsyncImpl(final InternalArangoDatabase<?, ?> db, final ArangoCursorExecute execute,
-									final Class<T> type, final CursorEntity result) {
+	ArangoCursorAsyncImpl(final InternalArangoDatabase<?, ?> db, final ArangoCursorExecute execute,
+						  final Class<T> type, final CursorEntity result) {
 		super(db, execute, type, result);
 	}
 
diff --git a/src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java
index bf9b2bc..3c0c4ab 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoDatabaseAsyncImpl.java
@@ -37,6 +37,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 
@@ -47,7 +48,7 @@
 public class ArangoDatabaseAsyncImpl extends InternalArangoDatabase<ArangoDBAsyncImpl, ArangoExecutorAsync>
         implements ArangoDatabaseAsync {
 
-    protected ArangoDatabaseAsyncImpl(final ArangoDBAsyncImpl arangoDB, final String name) {
+    ArangoDatabaseAsyncImpl(final ArangoDBAsyncImpl arangoDB, final String name) {
         super(arangoDB, name);
     }
 
@@ -63,7 +64,7 @@ public CompletableFuture<ArangoDBEngine> getEngine() {
 
     @Override
     public CompletableFuture<Boolean> exists() {
-        return getInfo().thenApply(info -> info != null).exceptionally(e -> e == null);
+        return getInfo().thenApply(Objects::nonNull).exceptionally(Objects::isNull);
     }
 
     @Override
@@ -397,7 +398,7 @@ public CompletableFuture<Void> reloadRouting() {
 
     @Override
     public ArangoRouteAsync route(final String... path) {
-        return new ArangoRouteAsyncImpl(this, createPath(path), Collections.<String, String>emptyMap());
+        return new ArangoRouteAsyncImpl(this, createPath(path), Collections.emptyMap());
     }
 
     @Override
diff --git a/src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java
index a54bd4a..1288933 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoEdgeCollectionAsyncImpl.java
@@ -36,7 +36,7 @@ public class ArangoEdgeCollectionAsyncImpl extends
 		InternalArangoEdgeCollection<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoGraphAsyncImpl, ArangoExecutorAsync>
 		implements ArangoEdgeCollectionAsync {
 
-	protected ArangoEdgeCollectionAsyncImpl(final ArangoGraphAsyncImpl graph, final String name) {
+	ArangoEdgeCollectionAsyncImpl(final ArangoGraphAsyncImpl graph, final String name) {
 		super(graph, name);
 	}
 
diff --git a/src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java b/src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java
index b37810c..7aa3b49 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoExecutorAsync.java
@@ -60,7 +60,7 @@ public <T> CompletableFuture<T> execute(final Request request, final ResponseDes
         return execute(request, responseDeserializer, null);
     }
 
-    public <T> CompletableFuture<T> execute(
+    private <T> CompletableFuture<T> execute(
             final Request request,
             final ResponseDeserializer<T> responseDeserializer,
             final HostHandle hostHandle) {
diff --git a/src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java
index aa87f83..d03c34c 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoGraphAsyncImpl.java
@@ -29,6 +29,7 @@
 import com.arangodb.model.GraphCreateOptions;
 
 import java.util.Collection;
+import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 
 /**
@@ -39,13 +40,13 @@ public class ArangoGraphAsyncImpl
 		extends InternalArangoGraph<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoExecutorAsync>
 		implements ArangoGraphAsync {
 
-	protected ArangoGraphAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
+	ArangoGraphAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
 		super(db, name);
 	}
 
 	@Override
 	public CompletableFuture<Boolean> exists() {
-		return getInfo().thenApply(info -> info != null).exceptionally(e -> e == null);
+		return getInfo().thenApply(Objects::nonNull).exceptionally(Objects::isNull);
 	}
 
 	@Override
@@ -66,8 +67,8 @@ public CompletableFuture<Void> drop() {
 	}
 
 	@Override
-	public CompletableFuture<Void> drop(boolean dropCollection) {
-		return executor.execute(dropRequest(dropCollection), Void.class);
+	public CompletableFuture<Void> drop(boolean dropCollections) {
+		return executor.execute(dropRequest(dropCollections), Void.class);
 	}
 
 	@Override
diff --git a/src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java
index 3e7b8ea..8ea4b24 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoRouteAsyncImpl.java
@@ -21,9 +21,7 @@
 package com.arangodb.async.internal;
 
 import com.arangodb.async.ArangoRouteAsync;
-import com.arangodb.internal.ArangoExecutor.ResponseDeserializer;
 import com.arangodb.internal.InternalArangoRoute;
-import com.arangodb.velocypack.exception.VPackException;
 import com.arangodb.velocystream.RequestType;
 import com.arangodb.velocystream.Response;
 
@@ -38,8 +36,8 @@ public class ArangoRouteAsyncImpl
 		extends InternalArangoRoute<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoExecutorAsync>
 		implements ArangoRouteAsync {
 
-	protected ArangoRouteAsyncImpl(final ArangoDatabaseAsyncImpl db, final String path,
-		final Map<String, String> headerParam) {
+	ArangoRouteAsyncImpl(final ArangoDatabaseAsyncImpl db, final String path,
+						 final Map<String, String> headerParam) {
 		super(db, path, headerParam);
 	}
 
@@ -67,12 +65,7 @@ public ArangoRouteAsync withBody(final Object body) {
 	}
 
 	private CompletableFuture<Response> request(final RequestType requestType) {
-		return executor.execute(createRequest(requestType), new ResponseDeserializer<Response>() {
-			@Override
-			public Response deserialize(final Response response) throws VPackException {
-				return response;
-			}
-		});
+		return executor.execute(createRequest(requestType), response -> response);
 	}
 
 	@Override
diff --git a/src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java
index 59a3b9d..0c08b86 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoSearchAsyncImpl.java
@@ -27,6 +27,7 @@
 import com.arangodb.model.arangosearch.ArangoSearchCreateOptions;
 import com.arangodb.model.arangosearch.ArangoSearchPropertiesOptions;
 
+import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 
 /**
@@ -37,13 +38,13 @@ public class ArangoSearchAsyncImpl
 		extends InternalArangoSearch<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoExecutorAsync>
 		implements ArangoSearchAsync {
 
-	protected ArangoSearchAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
+	ArangoSearchAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
 		super(db, name);
 	}
 
 	@Override
 	public CompletableFuture<Boolean> exists() {
-		return getInfo().thenApply(info -> info != null).exceptionally(e -> e == null);
+		return getInfo().thenApply(Objects::nonNull).exceptionally(Objects::isNull);
 	}
 
 	@Override
diff --git a/src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java
index 3a13e54..c6597e2 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoVertexCollectionAsyncImpl.java
@@ -36,7 +36,7 @@ public class ArangoVertexCollectionAsyncImpl extends
 		InternalArangoVertexCollection<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoGraphAsyncImpl, ArangoExecutorAsync>
 		implements ArangoVertexCollectionAsync {
 
-	protected ArangoVertexCollectionAsyncImpl(final ArangoGraphAsyncImpl graph, final String name) {
+	ArangoVertexCollectionAsyncImpl(final ArangoGraphAsyncImpl graph, final String name) {
 		super(graph, name);
 	}
 
diff --git a/src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java
index 1994746..2b8d173 100644
--- a/src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java
+++ b/src/main/java/com/arangodb/async/internal/ArangoViewAsyncImpl.java
@@ -24,6 +24,7 @@
 import com.arangodb.entity.ViewEntity;
 import com.arangodb.internal.InternalArangoView;
 
+import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 
 /**
@@ -33,13 +34,13 @@
 public class ArangoViewAsyncImpl extends
 		InternalArangoView<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoExecutorAsync> implements ArangoViewAsync {
 
-	protected ArangoViewAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
+	ArangoViewAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
 		super(db, name);
 	}
 
 	@Override
 	public CompletableFuture<Boolean> exists() {
-		return getInfo().thenApply(info -> info != null).exceptionally(e -> e == null);
+		return getInfo().thenApply(Objects::nonNull).exceptionally(Objects::isNull);
 	}
 
 	@Override
diff --git a/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java b/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java
index 40b793f..4f18bef 100644
--- a/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java
+++ b/src/main/java/com/arangodb/async/internal/velocystream/VstConnectionAsync.java
@@ -28,7 +28,6 @@
 
 import javax.net.ssl.SSLContext;
 import java.util.Collection;
-import java.util.concurrent.Callable;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.FutureTask;
 
@@ -93,16 +92,13 @@ private VstConnectionAsync(final HostDescription host, final Integer timeout, fi
 
 	public synchronized CompletableFuture<Message> write(final Message message, final Collection<Chunk> chunks) {
 		final CompletableFuture<Message> future = new CompletableFuture<>();
-		final FutureTask<Message> task = new FutureTask<>(new Callable<Message>() {
-			@Override
-			public Message call() throws Exception {
-				try {
-					future.complete(messageStore.get(message.getId()));
-				} catch (final Exception e) {
-					future.completeExceptionally(e);
-				}
-				return null;
-			}
+        final FutureTask<Message> task = new FutureTask<>(() -> {
+            try {
+                future.complete(messageStore.get(message.getId()));
+            } catch (final Exception e) {
+                future.completeExceptionally(e);
+            }
+            return null;
 		});
 		messageStore.storeMessage(message.getId(), task);
 		super.writeIntern(message, chunks);
