code: @Override
  	public boolean hasNext() throws IOException, InterruptedException{
  		if (this.lookahead != null) {
  			return true;
  		} else {
  			if (this.noMoreRecordsWillFollow) {
  				return false;
  			}
  			
  			T record = instantiateRecordType();
  			
  			while (true) {
  				InputChannelResult result = this.inputGate.readRecord(record);
  				switch (result) {
  					case INTERMEDIATE_RECORD_FROM_BUFFER:
  					case LAST_RECORD_FROM_BUFFER:
  						this.lookahead = record;
  						return true;
  						
  					case END_OF_SUPERSTEP:
  						if (incrementEndOfSuperstepEventAndCheck()) {
  							return false;
  						}
  						else {
  							break; // fall through and wait for next record/event
  						}
  						
  					case TASK_EVENT:
  						handleEvent(this.inputGate.getCurrentEvent());
  						break;
  						
  					case END_OF_STREAM:
  						this.noMoreRecordsWillFollow = true;
  						return false;
  				
  					default:
  						; // fall through the loop
  				}
  			}
  		}
  	}
docs: Checks if at least one more record can be read from the associated input gate. This method may block
  until the associated input gate is able to read the record from one of its input channels.
  
  @return <code>true</code>it at least one more record can be read from the associated input gate, otherwise
  <code>false</code>