title: Java: Inserting a pair of elements into linked list
body: <p>I'm new to Java, I am trying to add a group of elements into a linked list, my interface contains add single, pair, triple. Here is what I have so far for the methods.</p>
  
  <p>list is a linked list declared in constructor </p>
  
  <pre><code>public void addSingle(E item) {
      list.add(item);      
  }
  
  public void addPair(E first, E second) {
     E one = first;
     E two = second;
  
     LinkedList&lt;E&gt; pairList;
  
     pairList = new LinkedList&lt;E&gt;();
  
     pairList.add(one);
     pairList.add(two);
  
     list.addAll(pairList);
  }
  
   public static void main(String[] args) {
  
      Lists&lt;String&gt; linkdList = new ConcreteList&lt;String&gt;();
      linkdList.addSingle("allan");
  
      linkdList.addPair("abc","def");
  </code></pre>
  
  <p>}</p>
  
  <p>this adds everything into linkdList but need it to be able to differentiate between single and pair. </p>