core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorClusters.java
@SuppressWarnings("unchecked")
  public REC next() {
    checkDirection(true);

    if (currentRecord != null)
      try {
        // RETURN LAST LOADED RECORD
        return (REC) currentRecord;
      } finally {
        currentRecord = null;
      }

    ORecord record;

    // MOVE FORWARD IN THE CURRENT CLUSTER
    while (hasNext()) {
      if (currentRecord != null)
        try {
          // RETURN LAST LOADED RECORD
          return (REC) currentRecord;
        } finally {
          currentRecord = null;
        }

      record = getTransactionEntry();
      if (record == null)
        record = readCurrentRecord(null, +1);

      if (record != null)
        // FOUND
        if (include(record))
          return (REC) record;
    }

    record = getTransactionEntry();
    if (record != null)
      return (REC) record;

    throw new NoSuchElementException(
        "Direction: forward, last position was: " + current + ", range: " + beginRange + "-" + endRange);
  }
@SuppressWarnings("unchecked")
  public REC next() {
    checkDirection(true);

    if (currentRecord != null)
      try {
        // RETURN LAST LOADED RECORD
        return (REC) currentRecord;
      } finally {
        currentRecord = null;
      }

    ORecord record;

    // MOVE FORWARD IN THE CURRENT CLUSTER
    while (hasNext()) {
      if (currentRecord != null)
        try {
          // RETURN LAST LOADED RECORD
          return (REC) currentRecord;
        } finally {
          currentRecord = null;
        }

      record = getTransactionEntry();
      if (record == null)
        record = readCurrentRecord(null, +1);

      if (record != null)
        // FOUND
        if (include(record))
          return (REC) record;
    }

    record = getTransactionEntry();
    if (record != null)
      return (REC) record;

    throw new NoSuchElementException(
        "Direction: forward, last position was: " + current + ", range: " + beginRange + "-" + endRange);
  }
@ SuppressWarnings ( "unchecked" ) public REC next ( ) { checkDirection ( true ) ; if ( currentRecord != null ) try { // RETURN LAST LOADED RECORD
 return ( REC ) currentRecord ; } finally { currentRecord = null ; } ORecord record ; // MOVE FORWARD IN THE CURRENT CLUSTER
 while ( hasNext ( ) ) { if ( currentRecord != null ) try { // RETURN LAST LOADED RECORD
 return ( REC ) currentRecord ; } finally { currentRecord = null ; } record = getTransactionEntry ( ) ; if ( record == null ) record = readCurrentRecord ( null , + 1 ) ; if ( record != null ) // FOUND
 if ( include ( record ) ) return ( REC ) record ; } record = getTransactionEntry ( ) ; if ( record != null ) return ( REC ) record ; throw new NoSuchElementException ( "Direction: forward, last position was: " + current + ", range: " + beginRange + "-" + endRange ) ; }
Return the element at the current position and move forward the cursor to the next position available.

@return the next record found, otherwise the NoSuchElementException exception is thrown when no more records are found.
Return the element at the current position and move forward the cursor to the next position available .