public void testRepair(int putNodes[], boolean orphan) {
byte[] bKey = TestUtils.randomBytes(10);
String hexKey = ByteUtils.toHexString(bKey);
ByteArray baKey = new ByteArray(bKey);
BadKey badKey;
QueryKeyResult queryKeyResult;
if(!orphan) {
badKey = new BadKey(hexKey, hexKey + "\n");
queryKeyResult = null;
} else {
StringBuilder orphanInput = new StringBuilder();
orphanInput.append(hexKey + "," + "1\n");
List<Versioned<byte[]>> values = new ArrayList<Versioned<byte[]>>(0);
int arbitraryNodeId = 2;
Versioned<byte[]> versioned = TestUtils.getVersioned(TestUtils.randomBytes(25),
arbitraryNodeId);
orphanInput.append(ByteUtils.toHexString(versioned.getValue()));
orphanInput.append("," + versioned.toString() + "\n");
values.add(versioned);
badKey = new BadKey(hexKey, orphanInput.toString());
queryKeyResult = new QueryKeyResult(baKey, values);
}
Versioned<byte[]> value = TestUtils.getVersioned(TestUtils.randomBytes(25), 0);