private Map<Integer, Host> getPartitionAssignment(int numPartitions, Host... hosts) { List<AbstractMappingPartitionAssigner.HostAndIndexInRing> hostAndIndexInRings = new ArrayList<AbstractMappingPartitionAssigner.HostAndIndexInRing>(); for (int i = 0; i < hosts.length; ++i) { Host host = hosts[i]; if (host != null) { hostAndIndexInRings.add(new AbstractMappingPartitionAssigner.HostAndIndexInRing(host, i)); } } RendezVousPartitionAssigner partitionAssigner = new RendezVousPartitionAssigner(); Domain domain = new MockDomain("domain", 0, numPartitions, null, null, null, null); return partitionAssigner.getPartitionsAssignment(domain, hostAndIndexInRings); } }