code: private int getNextOptionInt(Iterator<Object> optionsIterator) throws IOException {
          for (;;) {
              if (!optionsIterator.hasNext())
                  throw new IllegalArgumentException();
              Object arg = optionsIterator.next();
              if (arg != null)
                  return (Integer) arg;
          }
      }
docs: Helper for processEscapeCommand() to iterate over integer options
  @param  optionsIterator  the underlying iterator
  @throws IOException      if no more non-null values left