title: Order List in java based on custom field value
body: <p>I have a list as follows:</p>
  
  <pre><code>List&lt;Data&gt; list = new ArrayList&lt;Data&gt;()
  
  Data {
      String status;
      String type;
  } 
  </code></pre>
  
  <p>From some Service I am getting data as below:</p>
  
  <pre><code>list = ["S","a"],["V","b"],["E","c"];
  </code></pre>
  
  <p>I need list to be ordered by status so that V,S,E so that I can pass it to filter for further processing:</p>
  
  <pre><code>updatedlist = ["V","a"],["E","b"],["S","c"];
  </code></pre>
  
  <p>I got understanding using compareTo we can arrange in ascending/descending order as follows but I dont need this</p>
  
  <pre><code>public int compare(Data d1, Data d2) {
  
            String status1= d1.getStatus();
            String status2= d2.getStatus();
  
            //ascending order
            return status1.compareTo(status2);
  
            //descending order
            //return status2.compareTo(status1);
          }
  </code></pre>
  
  <p>Please suggest how can achieve the List status order as V ,E,S.</p>