package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class BibliotecaApp {

    public static void main(String[] args) {
        BibliotecaApp biblioteca = new BibliotecaApp();
        biblioteca.go();
    }

    public void go() {
        Message message = new Message(System.out);
        message.printWelcome();

        MainMenu mainMenu = new MainMenu(makeMenuItems());
        mainMenu.printOptions(System.out);

        while(true) mainMenu.runMenuItem(chooseMenuItem(), System.out);
    }

    private ArrayList<Book> makeBookList() {
        Book b1 = new Book("High Fidelity", "Nick Hornby", 1995);
        Book b2 = new Book("The Divine Comedy", "Dante Alighieri", 1320);
        Book b3 = new Book("The Decameron", "Giovanni Boccaccio", 1353);
        ArrayList<Book> bookList = new ArrayList<Book>();
        bookList.addAll(Arrays.asList(b1, b2, b3));
        return bookList;
    }

    private ArrayList<MenuItem> makeMenuItems() {
        BookLister bookLister = new BookLister(makeBookList());
        ListOption listBooks = new ListOption("List Books", bookLister);
        CheckOutOption checkOut = new CheckOutOption("Check Out", bookLister);
        QuitOption quit = new QuitOption("Quit");
        ArrayList<MenuItem> items = new ArrayList<MenuItem>();
        items.addAll(Arrays.asList(listBooks, checkOut, quit));
        return items;
    }

    private String chooseMenuItem(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter a menu option command (first letter/s): ");
        return scanner.next().toUpperCase();
    }
}

@@ -1212,32 +1212,104 @@
 %22, bookLister);%0A
+        ReturnOption giveBack = new ReturnOption(%22Return%22, bookLister);%0A
         QuitOpti
@@ -1460,16 +1460,26 @@
 heckOut,
+ giveBack,
  quit));

integrate returnOption in BibliotecaApp