DatasetAffinityFunctionWrapper implements AffinityFunction { @Override public int partition(Object key) { return (Integer) key; } DatasetAffinityFunctionWrapper(AffinityFunction delegate); @Override void reset(); @Override int partitions(); @Override int partition(Object key); @Override List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx); @Override void removeNode(UUID nodeId);  }
@Test public void testPartition() { doReturn(0).when(affinityFunction).partition(eq(42)); int part = wrapper.partition(42); assertEquals(42, part); verify(affinityFunction, times(0)).partition(any()); }