public boolean checkout(List books) throws ApplicationException { // Validate list for (Iterator i = books.iterator(); i.hasNext(); ) { Object obj = i.next(); if !(obj instanceof Book) { throw new ApplicationException( ApplicationException.VALIDATION_ERROR, "Only Books are allowed in the input list"); } }