@Test
public void testGetAvoidsConflict() throws Exception {

    final FDBReverseDirectoryCache rdc = fdb.getReverseDirectoryCache();
    final int iterations = 20;
    final int parallelism = 2;
    final Executor executor = new ForkJoinPool(parallelism + 1);
    final Semaphore lock = new Semaphore(parallelism);
    for (int i = 0; i < iterations; i++) {
        final String name = "dir_" + Math.abs(new Random().nextInt());
        final Long id;
        try (FDBRecordContext context = openContext()) {
            id = globalScope.resolve(context.getTimer(), name).get();
        }
        final List<CompletableFuture<Void>> futures = IntStream.range(0, parallelism).mapToObj(k ->
                CompletableFuture.runAsync(() -> {
                    try {
                        lock.acquire();
                        rdc.get(globalScope.wrap(id)).get();
                    } catch (Exception e) {
                        throw new AssertionError(e);
                    }
                }, executor)).collect(Collectors.toList());
        lock.release(parallelism);
        AsyncUtil.whenAll(futures).get();
    }
}