@Test public void getBlockLocationsTest() { mInfo.addWorker(3, "HDD"); mInfo.addWorker(1, "MEM"); mInfo.addWorker(2, "MEM"); List<MasterBlockLocation> locations = mInfo.getBlockLocations(); Assert.assertEquals(3, mInfo.getNumLocations()); // mem in the top of the list Assert.assertEquals(1, locations.get(0).getWorkerId()); Assert.assertEquals(2, locations.get(1).getWorkerId()); Assert.assertEquals(3, locations.get(2).getWorkerId()); }