Parking { public boolean unparkCar(int index) { return slots.get(index).unpark(); } Parking(int edge, Set<Integer> pedestrianEntries, Set<Integer> disabledBays); int parkCar(char carType); boolean unparkCar(int index); @Override String toString(); int getAvailableBays();  }
@Test public void testUnparkCar() { final int firstCarBayIndex = parking.parkCar('C'); assertTrue(parking.unparkCar(firstCarBayIndex)); assertEquals(23, parking.getAvailableBays()); assertFalse(parking.unparkCar(firstCarBayIndex)); final int secondCarBayIndex = parking.parkCar('D'); assertTrue(parking.unparkCar(secondCarBayIndex)); assertEquals(23, parking.getAvailableBays()); assertFalse(parking.unparkCar(secondCarBayIndex)); assertFalse(parking.unparkCar(FIRSTUPEDESTRIANUEXITUINDEX)); }