title: Copy of a PriorityQueue without Interfere with the original PriorityQueue
body: <p>I am trying to copy a PriorityQueue object. </p>
  
  <p>My goal is to change some object of my Copy without modifying my original PriorityQueue</p>
  
  <p>In order to do so I did a copy of my PriorityQueue and I delete a value of my copy, but when I check if my PriorityQueue is stil the same, unfortunately the original PriorityQueue was changed as well... If you have any suggestion it will be welcome.</p>
  
  <p>Please find an example of what I tried : </p>
  
  <pre><code>public class PQExample
  {
      public int id;
      public int price;
      public String name;
      public long date;
  
          public PQExample(int id, int price, String name, long time)
          {
              this.id = id;
              this.price = price;
              this.name = name;
              this.date = time;
          }
  
          public static void main(String[] args)
          {
              PriorityQueueComparator pqc = new PriorityQueueComparator();
              PriorityQueue&lt;PQExample&gt; PQ = new PriorityQueue&lt;PQExample&gt;(pqc);
              int setID = 1000;
              int setDate = 0;
              PQ.add(new PQExample(setID++, 24 , "Mat", setDate++));
              PQ.add(new PQExample(setID++, 25 , "Tommy", setDate++));
              PQ.add(new PQExample(setID++, 22 , "Kate", setDate++));
              PQ.add(new PQExample(setID++, 26 , "Mary", setDate++));
              PQ.add(new PQExample(setID++, 24 , "Ronny", setDate++));
              PQExample valueToDel = new PQExample(1000,22,"Mat",0);
  
              PriorityQueue&lt;PQExample&gt; PQCopy = new PriorityQueue&lt;PQExample&gt;();
              PQCopy = PQ;
  
              //Now I want to delete only in PQCopy and not in PQ    
              PQCopy.remove(valueToDel);
  
              //Unfortunately Mat was deleted of both objects : PQ and PQCopy...
              for (int i = 0; i &lt; 4; i++) {
                  System.out.println("Queue in: " + i + " is " + PQ.peek().name + " with the price of " + PQ.peek().price);
                  PQ.poll();
              }
          }
  @Override
  public boolean equals(Object o)
  {
      if (o instanceof PQExample)
      {
          PQExample pqExample = (PQExample)o;
          return id == pqExample.id;
      }
      return false;
  }
  
  
  class PriorityQueueComparator implements Comparator&lt;PQExample&gt;
  {
      @Override
      public int compare(PQExample o1, PQExample o2) {
          if (o1.price &lt; o2.price){return 1;}else if (o1.price &gt; o2.price){return -1;}
          else
          {if (o1.date&lt;o2.date){return -1;}else{return 1;}}
      }
  }
  </code></pre>