/**
     * Parse JSON for Borrowed Books
     *
     * @param jar
     * @return
     * @throws UnsupportedEncodingException
     * @throws JSONException
     */
    private List<Book> parse(JSONArray jar) throws UnsupportedEncodingException, JSONException {
      List<Book> books = new ArrayList<>();

      for (int i = 0; i < jar.length(); i++) {
        JSONObject job = (JSONObject) jar.get(i);
        Book b = JSONParser.parseBook(job);
        // Friend f = JSONParser.parseFriend(job);
        User u = JSONParser.parseUser(job);
        BorrowedBook bb = new BorrowedBook();
        // bb.setRenter(f);
        bb.setBook(b);
        bb.setOwner(u);

        books.add(bb);
      }
      return books;
    }
 /**
  * Parse JSON for BorrowedBooks
  *
  * @param jar
  * @return
  */
 private List<Book> parse(JSONArray jar) {
   List<Book> borrowedBooks = new ArrayList<>();
   try {
     for (int i = 0; i < jar.length(); i++) {
       JSONObject job = (JSONObject) jar.get(i);
       Book b = JSONParser.parseBook(job);
       Friend f = JSONParser.parseFriend(job);
       User u = JSONParser.parseUser(job);
       BorrowedBook bb = new BorrowedBook();
       bb.setRenter(f);
       bb.setBook(b);
       bb.setOwner(u);
       borrowedBooks.add(bb);
     }
   } catch (UnsupportedEncodingException | JSONException e) {
     e.printStackTrace();
   }
   return borrowedBooks;
 }