title: Pagination in any List<?> Java
body: <p>my objective is create an pagination for any list as i want, by example the list below as 1000 items, and i want to generate an pagination that return propeties as page numbers, item quantity...and others atrributes commons on any pagination. How i can do this? know an library that can  help-me on this? i will use this in an rest api under spring framework.</p>
  <p>// any List that contains multiple elements</p>
  <pre><code>  public List&lt;Integer&gt; anyList() {
          List&lt;Integer&gt; list = new ArrayList&lt;&gt;();
          list.add(1);
          list.add(2);
          //list.add(...) ;
          list.add(1000);
          return list;
      }
  </code></pre>