package iterator; import java.util.List; public class SpaceKillerBypassIterator extends BypassIterator { private int size, count; public SpaceKillerBypassIterator(List<String> list) { super(list); this.size = list.size(); } @Override public boolean ProcessItem(String str) { System.out.println(str.replaceAll(" ", "")); return ++count < size; }}