title: How to rank collection of objects
body: <p>I have class, for example</p>
  
  <pre><code>class Person{
      Integer rank;
      Double profit;
      Person(Integer rank, Double profit){
          this.rank = rank;
          this.profit = profit;
      }
      Person(Double profit){
          this(0, profit);
      }
  }
  </code></pre>
  
  <p>I want to rank list of sorted by profit persons with rank evaluation.
  So that </p>
  
  <pre><code>rank(Arrays.asList(
      new Person(30), 
      new Person(20), 
      new Person(20), 
      new Person(10))
  )
  </code></pre>
  
  <p>will be produced into list </p>
  
  <pre><code>new Person(1, 30), 
  new Person(2, 20), 
  new Person(2, 20), 
  new Person(3, 10)
  </code></pre>
  
  <p>Also I want to do it using custom <code>Collector</code> (or something similar) from Java 8 and not to use simple loops. </p>