code: public RandomElementReader getElementReader(final String elementType)
              throws IOException {
          if (elementType == null) {
              throw new NullPointerException("elementType must not be null.");
          }
          if (!buffer.containsKey(elementType)) {
              throw new IllegalArgumentException("No such element type.");
          }
          if (closed) {
              throw new IllegalStateException("Reader is closed.");
          }
          while (buffer.get(elementType) == null) {
              ElementReader eReader = reader.nextElementReader();
              BufferedElementReader bReader = new BufferedElementReader(eReader);
              bReader.detach();
              buffer.put(eReader.getElementType().getName(), bReader);
          }
          return buffer.get(elementType).duplicate();
      }
docs: Returns an element reader for the given element type.
  @param elementType Element type.
  @return Reader for the elements of the given type.
  @throws IOException if reading fails.
  @throws NullPointerException if {@code elementType} is {@code null}.
  @throws IllegalArgumentException if there is no element with the given
  name.
  @throws IllegalStateException if this reader is closed.