title: Can we sort List<T> from Spring boot Pageable or sort page from PageImpl?
body: <p><strong>I have business logic to convert List to Page in Spring Boot.</strong> </p>
  
  <p>In that code, my pageable sort doesn't sort in the output. </p>
  
  <p><strong>Is there a way if I can sort via pageable or sort List from pageable.getSort()?</strong></p>
  
  <ul>
  <li><p>Note: I'm using new PageImpl() to convert List to Page.*</p>
  
  <p>int start = (int) pageable.getOffset();
  int end = (start + pageable.getPageSize()) > List.size() ? List.size() : (start + pageable.getPageSize());
  Page paginatedList = new PageImpl(floorsheetList.subList(start, end), pageable, list.size());</p></li>
  </ul>
  
  <p><strong>I actually get sorted= true but data won't sort.</strong></p>
  
  <pre><code>sort: {
  sorted: true,
  unsorted: false,
  empty: false
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>Turns out PageImpl cannot sort the data. So have to manually sort it via Collections or any other APIs.
  </code></pre>