when(balancer.size()).thenReturn(1);
when(balancer.iterator()).thenReturn(Collections.singleton(database).iterator());
when(balancer.next()).thenReturn(database);
when(cluster.getExecutor()).thenReturn(Executors.newCachedThreadPool());
when(cluster.getLockManager()).thenReturn(lockManager);
when(lockManager.readLock(null)).thenReturn(mock(Lock.class));
when(cluster.getDurability()).thenReturn(mock(Durability.class));
when(cluster.getTransactionIdentifierFactory()).thenReturn(mock(TransactionIdentifierFactory.class));
try
{