void prioritizeCopiesAndShiftUps(List<MigrationInfo> migrations) {
        for (int i = 0; i < migrations.size(); i++) {
            prioritize(migrations, i);
        }

        if (logger.isFinestEnabled()) {
            StringBuilder s = new StringBuilder("Migration order after prioritization: [");
            int ix = 0;
            for (MigrationInfo migration : migrations) {
                s.append("\n\t").append(ix++).append("- ").append(migration).append(",");
            }
            s.deleteCharAt(s.length() - 1);
            s.append("]");
            logger.finest(s.toString());
        }
    }
@Test
    public void testCopyPrioritizationAgainstMove()
            throws UnknownHostException {
        List<MigrationInfo> migrations = new ArrayList<>();
        final MigrationInfo migration1 = new MigrationInfo(0, null, new PartitionReplica(new Address("localhost", 5701), uuids[0]), -1, -1, -1, 0);
        final MigrationInfo migration2 = new MigrationInfo(0, null, new PartitionReplica(new Address("localhost", 5702), uuids[1]), -1, -1, -1, 1);
        final MigrationInfo migration3 = new MigrationInfo(0, new PartitionReplica(new Address("localhost", 5703), uuids[2]),
                new PartitionReplica(new Address("localhost", 5704), uuids[3]), 2, -1, -1, 2);
        final MigrationInfo migration4 = new MigrationInfo(0, new PartitionReplica(new Address("localhost", 5705), uuids[4]),
                new PartitionReplica(new Address("localhost", 5706), uuids[5]), 2, -1, -1, 3);
        final MigrationInfo migration5 = new MigrationInfo(0, null, new PartitionReplica(new Address("localhost", 5707), uuids[6]), -1, -1, -1, 4);
        migrations.add(migration1);
        migrations.add(migration2);
        migrations.add(migration3);
        migrations.add(migration4);
        migrations.add(migration5);

        migrationPlanner.prioritizeCopiesAndShiftUps(migrations);

        assertEquals(asList(migration1, migration2, migration5, migration3, migration4), migrations);
    }