Remove all 10s in a list and append a same number of 0s to the list at the end in JAVA
<p>I've done most part of this. Anyone give me a small hint about how do I find the number of 10s in the list. 
Eg. Input would be </p>

<blockquote>
  <p>[10,4,6,10,6,7]</p>
</blockquote>

<p>Output must be </p>

<blockquote>
  <p>[4,6,6,7,0,0]</p>
</blockquote>

<pre><code>import java.util.ArrayList;
import java.util.List;

public class prob64 {
   public static List output;
   public static void getVal(List ll)
   {
       int count=0;
       List ll1=new ArrayList();
       for(int i=0;i&lt;ll.size();i++)
       {
           if((int)ll.get(i)!=10)
           {
               ll1.add(ll.get(i));
           }
           if((int)ll.get(i)==10)
           {
               count++;
           }
       }
       if(count&gt;0)
       {
          ll1.add(8);
       }   
       output=ll1;
       System.out.println(output);
   }

   public static void main(String[] args) {
        List&lt;Integer&gt; ll=new ArrayList();
        ll.add(10);
        ll.add(1);
        ll.add(10);
        ll.add(2);
        prob64.getVal(ll);
   }
}
</code></pre>

<p>The current output I'm getting is <code>[1,2,0]</code>. I'm supposed to get <code>[1,2,0,0]</code></p>
