### Question:
ValueStore { public int addAndGetPosition(Block block, int position, long valueHash) { if (values.getPositionCount() >= maxFill) { rehash(); } int bucketId = getBucketId(valueHash, mask); int valuePointer; int probeCount = 1; int originalBucketId = bucketId; while (true) { checkState(probeCount < bucketCount, "could not find match for value nor empty slot in %s buckets", bucketCount); valuePointer = buckets.get(bucketId); if (valuePointer == EMPTY_BUCKET) { valuePointer = values.getPositionCount(); valueHashes.set(valuePointer, (int) valueHash); type.appendTo(block, position, values); buckets.set(bucketId, valuePointer); return valuePointer; } else if (equalOperator.equal(block, position, values, valuePointer)) { return valuePointer; } else { int probe = nextProbe(probeCount); bucketId = nextBucketId(originalBucketId, mask, probe); probeCount++; } } } @VisibleForTesting  ValueStore(Type type, BlockPositionEqual equalOperator, int expectedSize, BlockBuilder values); int addAndGetPosition(Block block, int position, long valueHash); int getRehashCount(); long getEstimatedSize();  }### Answer:
@Test public void testUniqueness() { assertEquals(valueStore.addAndGetPosition(block, 0, hashCodeOperator.hashCode(block, 0)), 0); assertEquals(valueStore.addAndGetPosition(block, 1, hashCodeOperator.hashCode(block, 1)), 1); assertEquals(valueStore.addAndGetPosition(block, 2, hashCodeOperator.hashCode(block, 2)), 2); assertEquals(valueStore.addAndGetPosition(block, 1, hashCodeOperator.hashCode(block, 1)), 1); assertEquals(valueStore.addAndGetPosition(block, 3, hashCodeOperator.hashCode(block, 1)), 3); }