### Question:
MigrationRouter { public List<MigrationPair> getMigrationPairOfPNode(int pNodeNo) { return allNodeMigrationPairs.get(pNodeNo); } MigrationRouter(int vNodes,	int oldPNodeCount, int newPNodeCount); int getNewPNodeCount(); int getOldPNodeCount(); List<MigrationPair> getMigrationPairOfPNode(int pNodeNo); List<List<MigrationPair>> getAllNodeMigrationPairs();  }### Answer:
@Test public void testGetMigrationPairOfPNode() { MigrationRouter migrationRouter = new MigrationRouter(10000, 3, 4); System.out.println(migrationRouter.getMigrationPairOfPNode(0)); List<List<MigrationPair>> allNodeMigrationPairs = migrationRouter.getAllNodeMigrationPairs(); Assert.assertTrue( allNodeMigrationPairs.size() == 3); List<MigrationPair> pairs = allNodeMigrationPairs.get( 0 ); for (MigrationPair pair : pairs) { if(pair.getVnode() == 3) { Assert.assertEquals(0, pair.getSource().intValue()); Assert.assertEquals(3, pair.getTarget().intValue()); } if(pair.getVnode() == 9) { Assert.assertEquals(1, pair.getSource().intValue()); Assert.assertEquals(3, pair.getTarget().intValue()); } if(pair.getVnode() == 11) { Assert.assertEquals(2, pair.getSource().intValue()); Assert.assertEquals(3, pair.getTarget().intValue()); } } }