if (size == 1) { for(int i = 0; i < size; i++) { System.out.println(i); } } else { for(int i = 0; i < size; i++) { System.out.println(i); } }