List objectsToRemove = new ArrayList(); List toRemoveList = Arrays.asList(phasesToRemove); Iterator iterToRemove = toRemoveList.iterator(); while (iterToRemove.hasNext()) { String toRemove = (String) iterToRemove.next(); objectsToRemove.add(infoPaymentPhases.get(Integer.valueOf(toRemove).intValue()));
Collection<InfoPaymentPhase> objectsToRemove = new ArrayList<InfoPaymentPhase>( phasesToRemove.length); for (String phaseToRemoveIndex : phasesToRemove) { objectsToRemove.add(infoPaymentPhases.get(Integer.valueOf(phaseToRemoveIndex)));
    private void removePhasesFromList(DynaValidatorForm gratuityForm, List infoPaymentPhases) {        String[] phasesToRemove = (String[]) gratuityForm.get("removedPhases");        List objectsToRemove = new ArrayList();        List toRemoveList = Arrays.asList(phasesToRemove);        Iterator iterToRemove = toRemoveList.iterator();        while (iterToRemove.hasNext()) {            String toRemove = (String) iterToRemove.next();            objectsToRemove.add(infoPaymentPhases.get(Integer.valueOf(toRemove).intValue()));        }        infoPaymentPhases.removeAll(objectsToRemove);        gratuityForm.set("removedPhases", new String[] {});    }