test_class.declarator: selectStatementContext
test_class.modifier: private
test_class.original_string: private SelectStatementContext selectStatementContext;
test_class.type: SelectStatementContext
test_class.var_name: selectStatementContext
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
test_class.identifier: IteratorStreamMergedResultTest
test_case.body: @Test
      public void assertNextForFirstResultSetsNotEmptyOnly() throws SQLException {
          List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
          when(queryResults.get(0).next()).thenReturn(true, false);
          ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
          MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
          assertTrue(actual.next());
          assertFalse(actual.next());
      }
test_case.class_method_signature: IteratorStreamMergedResultTest.assertNextForFirstResultSetsNotEmptyOnly()
test_case.full_signature: @Test public void assertNextForFirstResultSetsNotEmptyOnly()
test_case.identifier: assertNextForFirstResultSetsNotEmptyOnly
test_case.invocations: asList mock mock mock thenReturn when next get getActualDatabaseType merge assertTrue next assertFalse next
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertNextForFirstResultSetsNotEmptyOnly()
focal_class.declarator: queryResults
focal_class.modifier: private final
focal_class.original_string: private final Iterator<QueryResult> queryResults;
focal_class.type: Iterator<QueryResult>
focal_class.var_name: queryResults
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResult.java
focal_class.identifier: IteratorStreamMergedResult
focal_class.class_method_signature: IteratorStreamMergedResult.IteratorStreamMergedResult(final List<QueryResult> queryResults)
focal_class.full_signature: public  IteratorStreamMergedResult(final List<QueryResult> queryResults)
focal_class.identifier: IteratorStreamMergedResult
focal_class.modifiers: public
focal_class.parameters: (final List<QueryResult> queryResults)
focal_class.signature:  IteratorStreamMergedResult(final List<QueryResult> queryResults)
focal_class.class_method_signature: IteratorStreamMergedResult.next()
focal_class.full_signature: @Override public boolean next()
focal_class.identifier: next
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean next()
focal_class.superclass: extends StreamMergedResult
focal_method.body: @Override
      public boolean next() throws SQLException {
          if (getCurrentQueryResult().next()) {
              return true;
          }
          if (!queryResults.hasNext()) {
              return false;
          }
          setCurrentQueryResult(queryResults.next());
          boolean hasNext = getCurrentQueryResult().next();
          if (hasNext) {
              return true;
          }
          while (!hasNext && queryResults.hasNext()) {
              setCurrentQueryResult(queryResults.next());
              hasNext = getCurrentQueryResult().next();
          }
          return hasNext;
      }
focal_method.class_method_signature: IteratorStreamMergedResult.next()
focal_method.full_signature: @Override public boolean next()
focal_method.identifier: next
focal_method.invocations: next getCurrentQueryResult hasNext setCurrentQueryResult next next getCurrentQueryResult hasNext setCurrentQueryResult next next getCurrentQueryResult
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean next()