Source:
<code>public Object[] getElements(Object inputElement) { if (inputElement instanceof IWorkspaceRoot) { IWorkspaceRoot root = (IWorkspaceRoot) inputElement; List<IProject> projectList = new ArrayList<>(); IProject[] workspaceProjects = root.getProjects(); for (IProject workspaceProject : workspaceProjects) { if (isProjectExportable(workspaceProject)) { projectList.add(workspaceProject); } } return projectList.toArray(new IProject[projectList.size()]); } else if (inputElement instanceof IWorkingSetManager){ IWorkingSetManager manager = (IWorkingSetManager) inputElement; IWorkingSet[] allSets = manager.getAllWorkingSets(); ArrayList<IWorkingSet> resourceSets = new ArrayList<>(); for (IWorkingSet <START> allSet : <END> allSets) { if (isWorkingSetSupported(allSet)) { resourceSets.add(allSet); } } return resourceSets.toArray(new IWorkingSet[resourceSets.size()]); } else if (inputElement instanceof IAdaptable){ IProject[] tempProjects = getProjectsForObject(inputElement); if (tempProjects != null) return tempProjects; } else if (inputElement instanceof IAdaptable[]){ IAdaptable[] tempAdaptable = (IAdaptable[]) inputElement; return getProjectsForAdaptables(tempAdaptable); } else if (inputElement instanceof HashSet){ Set<IProject> tempList = new HashSet<>(); HashSet inputElementSet = (HashSet) inputElement; for (Iterator iterator = inputElementSet.iterator(); iterator.hasNext();) { IProject[] projects = getProjectsForObject(iterator.next()); if (projects != null) tempList.addAll(Arrays.asList(projects)); } return tempList.toArray(new IProject[tempList.size()]); } return null; }</code><technical_language>set</technical_language>

Target:
public Object[] getElements(Object inputElement) { if (inputElement instanceof IWorkspaceRoot) { IWorkspaceRoot root = (IWorkspaceRoot) inputElement; List<IProject> projectList = new ArrayList<>(); IProject[] workspaceProjects = root.getProjects(); for (IProject workspaceProject : workspaceProjects) { if (isProjectExportable(workspaceProject)) { projectList.add(workspaceProject); } } return projectList.toArray(new IProject[projectList.size()]); } else if (inputElement instanceof IWorkingSetManager){ IWorkingSetManager manager = (IWorkingSetManager) inputElement; IWorkingSet[] allSets = manager.getAllWorkingSets(); ArrayList<IWorkingSet> resourceSets = new ArrayList<>(); for (IWorkingSet set : allSets) { if (isWorkingSetSupported(set)) { resourceSets.add(set); } } return resourceSets.toArray(new IWorkingSet[resourceSets.size()]); } else if (inputElement instanceof IAdaptable){ IProject[] tempProjects = getProjectsForObject(inputElement); if (tempProjects != null) return tempProjects; } else if (inputElement instanceof IAdaptable[]){ IAdaptable[] tempAdaptable = (IAdaptable[]) inputElement; return getProjectsForAdaptables(tempAdaptable); } else if (inputElement instanceof HashSet){ Set<IProject> tempList = new HashSet<>(); HashSet inputElementSet = (HashSet) inputElement; for (Iterator iterator = inputElementSet.iterator(); iterator.hasNext();) { IProject[] projects = getProjectsForObject(iterator.next()); if (projects != null) tempList.addAll(Arrays.asList(projects)); } return tempList.toArray(new IProject[tempList.size()]); } return null; }