void (final Collection<? extends T> elements, final Collection<? extends T> elementsToSelect) { myChooser.clear(); for (final T item : elements) { myChooser.addElement(item, isElementMarkedByDefault(item), createElementProperties(item)); } myChooser.selectElements(elementsToSelect); }