title: Java: Sorting a queue
body: <p>I'm making a wrapper to queue type, but each time I add element, I want to sort everything inside. Mostly it will be <strong>Integer</strong>. I'm not too familiar with Collections framework, is there any simple solution ? </p>
  
  <pre><code>public class Round&lt;Type&gt; {
  
      private Queue&lt;Type&gt; qe;
  
      public Round(){
          this.qe = new LinkedList&lt;Type&gt;();
      }
  
  
      public void push(Type p){
          this.qe.offer(p);
          //Collections.sort(this.qe); Here I want to sort this
      }
  
  
      public Type pop(){
          return this.qe.poll();
      }
  }
  </code></pre>