private T deserialize( @Nonnull AbstractNeo4jSerializer<T> serializer, @Nonnull String serialized ) throws IOException {
GraphDatabaseService db = neo4jRule.createDb();
//Fill the db initially
try ( Transaction tx = db.beginTx() ) {
ExecutionResult result = new ExecutionEngine( db ).execute( serialized );
tx.success();
}
try ( Transaction tx = db.beginTx() ) {
return serializer.deserialize( db.getNodeById( 0 ) );