if (!(object instanceof BootstrapCook)) return null;
Collection menu = ((BootstrapCook) object).cook(context);
Iterator iter = menu.iterator();
while (iter.hasNext()) {
MenuItem item = (MenuItem) iter.next();
if (item instanceof CreateInstanceMenuItem) {
list.add(item);
}
}
iter = menu.iterator();
while (iter.hasNext()) {
MenuItem item = (MenuItem) iter.next();
if (!(item instanceof CreateInstanceMenuItem)) {
list.add(item);
}
}
}