@Test
public void buildNullFilterTest() throws Exception {

    MongoConnectionHandler connectionHandler = Mockito.mock(MongoConnectionHandler.class);
    Connection<MongoClient> connection = Mockito.mock(Connection.class);
    MongoClient client = Mockito.mock(MongoClient.class);
    DB database = Mockito.mock(DB.class);
    DBCollection collection = Mockito.mock(DBCollection.class);
    MongoStorageEngine mongoStorageEngine;
    when(connectionHandler.getConnection(CLUSTER_NAME)).thenReturn(connection);
    when(connection.getNativeConnection()).thenReturn(client);
    mongoStorageEngine = MongoStorageEngine.getInstance((MongoConnectionHandler) connectionHandler);
    when(client.getDB(DB_NAME)).thenReturn(database);
      DBCollection collection = mock(DBCollection.class);
    when(client.getDB(DB_NAME)).thenReturn(database);
    when(database.getCollection(COLLECTION_NAME)).thenReturn(collection);
    Method method = mongoStorageEngine.getClass().getDeclaredMethod("buildFilter", Collection.class);
    method.setAccessible(true);
    DBObject filter = (DBObject) method.invoke(mongoStorageEngine, (Collection<Filter>) null);
    Assert.assertEquals("If there is no filters the query has to match all", new BasicDBObject(), filter);
}