@Override public Simulation next() { if (exprIt == null) { throw new RuntimeException("Iterator not initialised, please call build()"); } if (current == null || !current.hasNext()) { if (exprIt.hasNext()) current = exprIt.next(); else throw new NoSuchElementException(); } return current.next(); }
@Override public boolean hasNext() { return exprIt.hasNext() || (current != null && current.hasNext()); }