package com.twu.biblioteca;
import java.util.List;
import java.util.ArrayList;

public class BibliotecaApp {

    private static List<Book> bookList = initBookList();

    public static void main(String[] args) {
        System.out.println("Welcome to Biblioteca!");
        printBookList();
    }

    private static void printBookList() {
        System.out.println("Book list:");
        for (Book book : bookList) {
            System.out.println(book.toString());
        }
    }

    private static List<Book> initBookList() {
        List<Book> newBookList = new ArrayList<Book>();
        newBookList.add(createNewBook("Test-Driven Development By Example", "Kent Beck", 2003));
        newBookList.add(createNewBook("The Agile Samurai", "Jonathan Rasmusson", 2010));
        newBookList.add(createNewBook("Head First Java", "Kathy Sierra & Bert Bates", 2005));
        newBookList.add(createNewBook("Don't Make Me Think, Revisited: A Common Sense Approach to Web Usability", "Steve Krug", 2014));
        return newBookList;
    }

    private static Book createNewBook(String title, String author, int yearPublished) {
        return new Book(title, author, yearPublished);
    }
}

@@ -371,13 +371,12 @@
 ook 
-l
+L
 ist
-:
 %22);%0A
@@ -387,82 +387,319 @@
     
-for (Book book : bookList) %7B%0A            System.out.println(book.toString(
+System.out.print(String.format(%22%25-42s %7C %25-32s %7C %25-12s%5Cn%22, %22Title%22, %22Author%22, %22Year Published%22));%0A        String leftAlignFormat = %22%25-42s %7C %25-32s %7C %25-4d%5Cn%22;%0A        for (Book book : bookList) %7B%0A            System.out.print(String.format(leftAlignFormat, book.getTitle(), book.getAuthor(), book.getYearPublished()
 ));%0A
@@ -1171,50 +1171,8 @@
 ited
-: A Common Sense Approach to Web Usability
 %22, %22

Print book list with author and year published details