code: @Override
      public boolean hasNext() {
          if (!nextAvailableIsKnown) {
              hasNext = false;
  
              // now try to parse the next Molecule
              try {
  
                  final String line = input.readLine();
  
                  if (line == null) {
                      nextAvailableIsKnown = true;
                      return false;
                  }
  
                  hasNext = true;
                  final String suffix = suffix(line);
  
                  nextMolecule = readSmiles(line);
                  nextMolecule.setTitle(suffix);
  
              } catch (Exception exception) {
                  logger.error("Unexpected problem: ", exception.getMessage());
                  logger.debug(exception);
                  hasNext = false;
              }
              if (!hasNext) nextMolecule = null;
              nextAvailableIsKnown = true;
          }
          return hasNext;
      }
docs: Checks whether there is another molecule to read.
  
  @return  true if there are molecules to read, false otherwise