public int partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, Cluster cluster) {
        return partition(topic, key, keyBytes, value, valueBytes, cluster, cluster.partitionsForTopic(topic).size());
    }
@Test
    public void testKeyPartitionIsStable() {
        @SuppressWarnings("deprecation")
        final Partitioner partitioner = new DefaultPartitioner();
        final Cluster cluster = new Cluster("clusterId", asList(NODES), PARTITIONS,
            Collections.emptySet(), Collections.emptySet());
        int partition = partitioner.partition(TOPIC,  null, KEY_BYTES, null, null, cluster);
        assertEquals(partition, partitioner.partition(TOPIC, null, KEY_BYTES, null, null, cluster), "Same key should yield same partition");
    }