package com.twu.biblioteca;

import java.util.List;

public class Books {
    private List<Book> books;

    public Books(List<Book> books) {
        this.books = books;
    }

    //    public Books() {
//        books = new ArrayList<>();
//        books.add(new Book("Harry Potter and The Sorcer's Stone", "JK Rowling", 1999));
//        books.add(new Book("Harry Potter and The Chamber of Secrets", "JK Rowling", 2000));
//    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        for (Book book : books) {
            sb.append(book).append("\n");
        }
        sb.deleteCharAt(sb.length() - 1);
        return sb.toString();
    }
}
@@ -174,265 +174,8 @@
  %7D%0A%0A
-    //    public Books() %7B%0A//        books = new ArrayList%3C%3E();%0A//        books.add(new Book(%22Harry Potter and The Sorcer's Stone%22, %22JK Rowling%22, 1999));%0A//        books.add(new Book(%22Harry Potter and The Chamber of Secrets%22, %22JK Rowling%22, 2000));%0A//    %7D%0A%0A
     

Refactor - removed comments