Not entirely sure what you're getting at. By my eye, a for-each loop is totally viable:

```java
if (obj.get(key) != null && obj.get(key).isArray()) {
                    ArrayNode arrayNode = (ArrayNode) obj.get(key);
                    arrayNode.removeAll();
                    for (String val : Splitter.on('|').trimResults().split(value)) {
                        arrayNode.add(val);
                    }
                }
```