title: What is the correct way of return a List in Spring
body: <p>I have written a method which annotated with a Spring.it will return a List. following code snip will represent that method.</p>
  
  <pre><code>   @RequestMapping(path = "", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
      public ResponseEntity&lt;ReservationResponse&gt; getAvailableRooms(
              @RequestParam(name = "checkin")
              @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
              LocalDate checkin,
              @RequestParam(name = "checkout")
              @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
              LocalDate checkout) {
  
          return new ResponseEntity&lt;&gt;(new ReservationResponse(), HttpStatus.OK);
      }
  </code></pre>
  
  <p>What i want to know is if i write it as this will it be a wrong?</p>
  
  <pre><code>@RequestMapping(path = "", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResponseEntity&lt;ReservationResponse&gt; getAvailableRooms(
          @RequestParam(name = "checkin")
          @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
          LocalDate checkin,
          @RequestParam(name = "checkout")
          @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
          LocalDate checkout) {
          ResponseEntity&lt;ReservationResponse&gt; reservationResponse = new ResponseEntity&lt;ReservationResponse&gt;();
      return (reservationResponse, HttpStatus.OK);
      }
  </code></pre>