private static void copySelection(SelectionProvider from, SelectionProvider to) {
    to.clearSelection();
    for (Object aSelection : from.getSelection()) {
      to.addSelection(aSelection);
    }
  }
private static void copySelection(SelectionProvider from, SelectionProvider to)