while (iterator.hasNext()){ if ("4".equals(iterator.next())){ iterator.remove(); } } strings.forEach(val ->{ strings.remove("4"); strings.add("3"); });