title: How can I pass data from ArrayList<String> to List<Class?
body: <p>I want to save/parse data from ArrayList to List but I'm not able to figure out how can I achieve it.</p>
  
  <p>I have 2 Lists as below:</p>
  
  <pre><code>public static ArrayList&lt;String&gt; list2= new ArrayList&lt;&gt;();
  public static List&lt;Contact&gt; sortedList= new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>list2 is having data like </p>
  
  <pre><code>ArrayList&lt;String&gt; list2 = ["9847523587", "6738654738"]
  </code></pre>
  
  <p>I want list2 data in sortedList.
  How can I get that?</p>
  
  <p>Contact.java</p>
  
  <pre><code>public class Contact implements Serializable, Comparable&lt;Contact&gt; {
  /**
   *
   */
  
  private String fullName, firstName, lastName, androidId, androidRawId, androidTagId, organization;
  private transient Uri photoUri, thumbnailUri;
  private List&lt;NumberOrAddress&gt; addresses;
  private transient ArrayList&lt;ContentProviderOperation&gt; changesToCommit;
  private transient ArrayList&lt;ContentProviderOperation&gt; changesToCommit2;
  
  public void setInitial(String initial) {
      this.initial = initial;
  }
  
  public Contact() {
      addresses = new ArrayList&lt;&gt;();
      androidId = null;
      thumbnailUri = null;
      photoUri = null;
      changesToCommit = new ArrayList&lt;&gt;();
  
      changesToCommit2 = new ArrayList&lt;&gt;();
      hasSipAddress = false;
  }
  }
  }
  </code></pre>
  
  <p>Added Contact.java just to show how its constructed.</p>