private void showLoans() 
    {
        List<Book> books = library.getLoanedBooks();
        List<Cd> CDs = library.getLoanedCds();
        List<Magazine> magazines = library.getLoanedMagazines();
        boolean done = false;
        do {
            printHeader("Books");
            int index = 1;
            printBooks(index, books);
            index += books.size();
            printHeader("CDs");
            printCDs(index, CDs);
            index += CDs.size();
            printHeader("Magazines");
            printMagazines(index, magazines);
            printFooter();

            stream.println("1. return item.");
            stream.println("2. go back");
            
            int userChoice = scanner.nextInt();
            switch(userChoice)
            {
                case 1:
                    stream.println("index: > ");
                    index = scanner.nextInt() - 1;
                    LibraryItem li = null;
                    if (index < books.size()) {
                        li = books.remove(index);
                    } else {
                        index -= books.size();
                        if (index < CDs.size()) {
                            li = CDs.remove(index);
                        } else {
                            index -= CDs.size();
                            if (index < magazines.size()) {
                                li = magazines.remove(index);
        }
    }
    }
                    if (li != null) {
                        library.returnLibraryItem(li);
                        stream.println("returned");
                    }
                    break;
                case 2:
                    done = true;
                    break;
                default:
                    break;
            }
        } while(!done);
    }