package pack; import java.util.LinkedList; import java.util.List; public class Test { public void test(){ List list = new LinkedList(); Integer count = new Integer(0); if( list != null){ if( 0 < list.size() && list.size() < 3) { if( list.get(0) == list.get(1)){ count = new Integer(1); }else if (list.get(0) == list.get(2)){ count = new Integer(2); }else if (list.get(1) == list.get(2)){ count = new Integer(3); }else{ count = new Integer(4); } }else { if (0 < list.size() && list.size() < 2){ if( list.get(0) == list.get(1)){ count = new Integer(5); } } } }else{ count = new Integer(6); } } }