PartitionKey implements Comparable<PartitionKey> { public int getLength() { return partitionKey.length; } PartitionKey(final Object[] partitionKey); Object[] getPartitionKey(); int getLength(); @Override String toString(); @Override int compareTo(final PartitionKey other); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void testLengthMethod() { final PartitionKey partitionKey1 = new PartitionKey(new Object[]{1L, 50, "A"}); final PartitionKey partitionKey2 = new PartitionKey(new Object[]{1L, 50, "A", "X"}); final int partitionKey1Length = partitionKey1.getLength(); final int partitionKey2Length = partitionKey2.getLength(); assertEquals(3, partitionKey1Length); assertEquals(4, partitionKey2Length); }