title: Java 8 Stream Filter - Sort based pdate
body: <p>Am trying to sort the filed in filter.</p>
  
  <p>Input Document / Sample Record:</p>
  
  <pre><code>DocumentList: [
      Document{
          {
              _id=5975ff00a213745b5e1a8ed9,
              u_id=,
              mailboxcontent_id=5975ff00a213745b5e1a8ed8,                
              idmapping=Document{
                  {ptype=PDF, cid=00988, normalizedcid=00988, systeminstanceid=, sourceschemaname=, pid=0244810006}
              },
              batchid=null,
              pdate=Tue Jul 11 17:52:25 IST 2017, locale=en_US
          }
      },
      Document{
          {
              _id=597608aba213742554f537a6,
              u_id=,
              mailboxcontent_id=597608aba213742554f537a3, 
              idmapping=Document{
                  {platformtype=PDF, cid=00999, normalizedcid=00999, systeminstanceid=, sourceschemaname=, pid=0244810006}
              },
              batchid=null,
              pdate=Fri Jul 28 01:26:22 IST 2017,
              locale=en_US
          }
      }
  ]
  </code></pre>
  
  <p>Here, I need to sort based on pdate.</p>
  
  <pre><code>List&lt;Document&gt; outList = documentList.stream()
      .filter(p -&gt; p.getInteger(CommonConstants.VISIBILITY) == 1)
      .parallel()
      .sequential()
      .collect(Collectors.toCollection(ArrayList::new))
      .sort()
      .skip(skipValue)
      .limit(limtValue);
  </code></pre>
  
  <p>Not sure how to sort </p>
  
  <pre><code>"order by pdate DESC"
  </code></pre>
  
  <p>Thank you in advance!</p>