PeList { public static <T extends Pe> boolean setPeStatus(List<T> peList, int id, int status) { Pe pe = getById(peList, id); if (pe != null) { pe.setStatus(status); return true; } return false; }  static Pe getById(List<T> peList, int id); static int getMips(List<T> peList, int id); static int getTotalMips(List<T> peList); static double getMaxUtilization(List<T> peList); static double getMaxUtilizationAmongVmsPes(List<T> peList, Vm vm); static Pe getFreePe(List<T> peList); static int getNumberOfFreePes(List<T> peList); static boolean setPeStatus(List<T> peList, int id, int status); static int getNumberOfBusyPes(List<T> peList); static void setStatusFailed(
			List<T> peList,
			String resName,
			int hostId,
			boolean failed); static void setStatusFailed(List<T> peList, boolean failed);  }
@Test public void testSetPeStatus() { assertEquals(2, PeList.getNumberOfFreePes(peList)); assertEquals(0, PeList.getNumberOfBusyPes(peList)); assertTrue(PeList.setPeStatus(peList, 0, Pe.BUSY)); assertEquals(Pe.BUSY, PeList.getById(peList, 0).getStatus()); assertEquals(1, PeList.getNumberOfFreePes(peList)); assertEquals(1, PeList.getNumberOfBusyPes(peList)); assertTrue(PeList.setPeStatus(peList, 1, Pe.BUSY)); assertEquals(Pe.BUSY, PeList.getById(peList, 1).getStatus()); assertEquals(0, PeList.getNumberOfFreePes(peList)); assertEquals(2, PeList.getNumberOfBusyPes(peList)); assertFalse(PeList.setPeStatus(peList, 2, Pe.BUSY)); assertEquals(0, PeList.getNumberOfFreePes(peList)); assertEquals(2, PeList.getNumberOfBusyPes(peList)); }