title: Initialize a list of object at spring boot start up
body: <p>I have a List of Book objects which needs to be initialized at Spring boot start up. The list of book is constant and due to DB optimization I don't want to store the data in database and call it every time.</p>
  <p>Book class is as below:</p>
  <pre><code>Class Book{
     private String name;
     private String author;
     private int pages;
     private boolean issued;
  }
  
  constructors, getters and setters ....
  </code></pre>
  <p>Suppose I have 3 books as (book1,author1,100,true),(book2,author2,50,false) and (book3,author3,350,true)</p>
  <p>Which is the best way of initializing the list while spring startup. Moreover once the initialization is done which is the best way in which I can return it through a Get endpoint method in controller as</p>
  <pre><code>@GetMapping(value=&quot;/books&quot;)
  public List&lt;Book&gt; getBooks(){
    ....
    return &lt;List of three books&gt;;
  }
  </code></pre>
  <p>Thanks in advance.</p>
  <p>Regards,
  Sameekshya</p>