@Test public void testNextWhenNoValueIsPresent() { List<String> listOfWithoutElement = ImmutableList.of(); when(stream.iterator()).thenReturn(listOfWithoutElement.iterator()); scanner = new RowResultScanner<>(stream, TEST_ARRAY); assertNull(scanner.next()); verify(stream).iterator(); }
@Override public T next() { if (!iterator.hasNext()) { return null; } try (Timer.Context ignored = resultsTimer.time()) { T result = iterator.next(); resultsMeter.mark(); return result; } catch (RuntimeException e) { throw e; } }
RowResultScanner implements ResultScanner<T> { @Override public T next() { if (!iterator.hasNext()) { return null; } try (Timer.Context ignored = resultsTimer.time()) { T result = iterator.next(); resultsMeter.mark(); return result; } catch (RuntimeException e) { throw e; } } }
RowResultScanner implements ResultScanner<T> { @Override public T next() { if (!iterator.hasNext()) { return null; } try (Timer.Context ignored = resultsTimer.time()) { T result = iterator.next(); resultsMeter.mark(); return result; } catch (RuntimeException e) { throw e; } } RowResultScanner(ServerStream<T> stream, T[] arr); }
RowResultScanner implements ResultScanner<T> { @Override public T next() { if (!iterator.hasNext()) { return null; } try (Timer.Context ignored = resultsTimer.time()) { T result = iterator.next(); resultsMeter.mark(); return result; } catch (RuntimeException e) { throw e; } } RowResultScanner(ServerStream<T> stream, T[] arr); @Override T next(); @Override T[] next(int count); @Override int available(); @Override void close(); }
RowResultScanner implements ResultScanner<T> { @Override public T next() { if (!iterator.hasNext()) { return null; } try (Timer.Context ignored = resultsTimer.time()) { T result = iterator.next(); resultsMeter.mark(); return result; } catch (RuntimeException e) { throw e; } } RowResultScanner(ServerStream<T> stream, T[] arr); @Override T next(); @Override T[] next(int count); @Override int available(); @Override void close();  }