Fetcher { public Fetcher skipNulls() { this.skipNulls = true; return this; } Fetcher(Cursor cursor); static Fetcher of(Cursor cursor); Fetcher skipNulls(); Optional<ResultT> toValue(Converter<ResultT> converter); List<ResultT> toList(Converter<ResultT> converter); Set<ResultT> toSet(Converter<ResultT> converter); CollT toCollection(Converter<ResultT> converter, CollT results); int count();  }
@Test public void skipNulls() { when(cursor.getCount()).thenReturn(3); when(cursor.moveToNext()).thenReturn(true, true, true, false); when(cursor.getString(0)).thenReturn("First", null, "Third"); Fetcher fetcher = Fetcher.of(cursor).skipNulls(); List<String> result = fetcher.toList(Converter.STRING); assertThat(result).isNotNull().hasSize(2) .contains("First", "Third") .doesNotContain((String) null); }