@Test
public void testNotFullSetOfOldKeysUsesUserRepairAlg() throws IllegalAccessException {

    Map<VersionedKey, Map<UUID, VersionedValue>> data = new HashMap<>();
    VersionedKey key = new VersionedKey(null, new KeyCacheObjectImpl(), null);
    Map<UUID, VersionedValue> keyVers = new HashMap<>();
    keyVers.put(NODE_1, versionedValue("1", 1));
    keyVers.put(NODE_2, versionedValue("2", 2));
    keyVers.put(NODE_3, versionedValue("2", 2));
    keyVers.put(NODE_4, versionedValue("4", 4));
    data.put(key, keyVers);
    IgniteEx igniteMock = igniteMock(true);
    ExecutionResult<RepairResult> res = injectIgnite(repairJob(data, 5, 1), igniteMock).execute();
    assertTrue(res.result().keysToRepair().isEmpty());
    assertEquals(1, res.result().repairedKeys().size());
    Map.Entry<VersionedKey, RepairMeta> entry = res.result()
        .repairedKeys().entrySet().iterator().next();
    assertEquals(keyVers, entry.getValue().getPreviousValue());
    RepairMeta repairMeta = entry.getValue();
    assertTrue(repairMeta.fixed());
    assertEquals(repairAlgorithm, repairMeta.repairAlg());
    switch (repairAlgorithm) {
        case LATEST:
            assertCacheObjectEquals(keyVers.get(NODE_4).value(), repairMeta.value());
            break;
        case PRIMARY:
            assertCacheObjectEquals(keyVers.get(NODE_1).value(), repairMeta.value());
            break;
        case MAJORITY:
            assertCacheObjectEquals(keyVers.get(NODE_2).value(), repairMeta.value());
            break;
        case REMOVE:
            assertCacheObjectEquals(null, repairMeta.value());
            break;
    }
}