I'm trying to iterate through a list and add all matching nodes to another list. However in the specific line affiliateResults.add(iterator.next()), iterator.next doesn't return an object, as when I later inspect affiliateResults it is empty. Any ideas where I'm going wrong?
Thanks Ulf and Matt, with your help I saw the errors of my ways and got it working.
Matt, thank you so much for your advice about the inner if conditional, when I was writing it I was thinking "there has to be better way", did consider && but had completely forgotten that it short circuits so thought if I used it it might blow up if x.equals("yes") was run before the null check.