@Test
public void testCopiedDirectoryStartsAllocationBeyondOriginal() {

    Map<String, ResolverResult> dirLayerMappings;
    try (FDBRecordContext context = database.openContext()) {
        dirLayerMappings = seedDirectoryLayer(context, primary, 20);
    }
    final Long maxMappedValue = dirLayerMappings.entrySet().stream()
            .max(ResolverMappingReplicatorTest::resolverResultComparator)
            .map(max -> max.getValue().getValue())
            .orElseThrow(IllegalStateException::new);
    ResolverMappingReplicator replicator = new ResolverMappingReplicator(primary);
    replicator.copyTo(replica);
    try (FDBRecordContext context = database.openContext()) {
        for (int i = 0; i < 20; i++) {
            String key = "new-value-" + random.nextLong();
            Long mapped = replica.resolve(context.getTimer(), key).join();
            assertThat("new mapped values are all greater than max from original directory layer",
                    mapped, is(greaterThan(maxMappedValue)));
        }
    }
}