void (List<String> annotations) { final Set<String> set = new HashSet<>(annotations); int row = 0; for (String annotation : getAnnotations()) { if (!set.contains(annotation)) { myTableModel.removeRow(row); } else { set.remove(annotation); row++; } } for (String annotation : set) { addRow(annotation, false); } }