} else if (object instanceof byte[]) {
return new ByteArrayIterator((byte[]) object);
} else if (object instanceof char[]) {
return new CharArrayIterator((char[]) object);
} else if (object instanceof boolean[]) {
return new BooleanArrayIterator((boolean[]) object);
} else {
throw new UnsupportedOperationException("Unsupported foreach type " + object.getClass().getName());
}
}