package com.twu.biblioteca.domain.repo;


import com.twu.biblioteca.domain.model.Book;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;

public class BookRepo {

    private final Map<Integer, Book> listOfBooks = new HashMap<>();

    public BookRepo() {
        this.initBooks();
    }

    public Map<Integer, Book> getListOfBooks() {
        return listOfBooks;
    }

    public Book getBookById(int i) {
        return this.listOfBooks.get(i);
    }

    private void initBooks() {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        try {
            listOfBooks.put(1, new Book(1, "Refactoring", "Martin Fowler & Kent Beck", formatter.parse("1999-07-08")));
            listOfBooks.put(2, new Book(2, "Clean Code", "Robert C. Martin", formatter.parse("2008-08-11")));
            listOfBooks.put(3, new Book(3, "Test Driven Development: By Example", "Kent Beck", formatter.parse("2002-11-18")));
            listOfBooks.put(4, new Book(4, "The Art of Readable Code", "Dustin Boswell & Trevor Foucher", formatter.parse("2011-12-02")));
            listOfBooks.put(5, new Book(5, "Patterns of Enterprise Application Architecture", "Martin Fowler", formatter.parse("2002-11-15")));
            listOfBooks.put(6, new Book(6, "Extreme Programming Explained: Embrace Chang", "Kent Beck & Cynthia Andres ", formatter.parse("2011-09-01")));
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}

@@ -413,16 +413,21 @@
  return 
+this.
 listOfBo
@@ -470,17 +470,22 @@
 yId(int 
-i
+bookId
 ) %7B%0A    
@@ -516,17 +516,22 @@
 oks.get(
-i
+bookId
 );%0A    %7D
@@ -654,32 +654,37 @@
 y %7B%0A            
+this.
 listOfBooks.put(
@@ -779,32 +779,37 @@
 ));%0A            
+this.
 listOfBooks.put(
@@ -894,32 +894,37 @@
 ));%0A            
+this.
 listOfBooks.put(
@@ -1027,32 +1027,37 @@
 ));%0A            
+this.
 listOfBooks.put(
@@ -1171,32 +1171,37 @@
 ));%0A            
+this.
 listOfBooks.put(
@@ -1328,16 +1328,21 @@
         
+this.
 listOfBo

use this to make variable clear