public MediaCopy findAvailableCopy(String id) { List copies = findAllCopies(id); for (int i = 0; i < copies.size(); i++) { MediaCopy copy = (MediaCopy) copies.get(i); if (!copy.isLoaned()) return copy; } return null; }
public void testShouldSetCopyToBorrowed() throws Exception { receipt = library.loan(copy, patron); assertTrue(copy.isLoaned()); }