@Test public void assertDivide() throws SQLException { List<DistinctQueryResult> actual = aggregationDistinctQueryResult.divide(); assertThat(actual.size(), is(2)); assertThat(actual.iterator().next().getColumnCount(), is((Object) 5)); }
@Override public List<DistinctQueryResult> divide() { return Lists.newArrayList(Iterators.transform(getResultData(), new Function<QueryRow, DistinctQueryResult>() { @Override public DistinctQueryResult apply(final QueryRow input) { Set<QueryRow> resultData = new LinkedHashSet<>(); resultData.add(input); return new AggregationDistinctQueryResult(getQueryResultMetaData(), resultData.iterator(), metaData); } })); }
AggregationDistinctQueryResult extends DistinctQueryResult { @Override public List<DistinctQueryResult> divide() { return Lists.newArrayList(Iterators.transform(getResultData(), new Function<QueryRow, DistinctQueryResult>() { @Override public DistinctQueryResult apply(final QueryRow input) { Set<QueryRow> resultData = new LinkedHashSet<>(); resultData.add(input); return new AggregationDistinctQueryResult(getQueryResultMetaData(), resultData.iterator(), metaData); } })); } }
AggregationDistinctQueryResult extends DistinctQueryResult { @Override public List<DistinctQueryResult> divide() { return Lists.newArrayList(Iterators.transform(getResultData(), new Function<QueryRow, DistinctQueryResult>() { @Override public DistinctQueryResult apply(final QueryRow input) { Set<QueryRow> resultData = new LinkedHashSet<>(); resultData.add(input); return new AggregationDistinctQueryResult(getQueryResultMetaData(), resultData.iterator(), metaData); } })); } private  AggregationDistinctQueryResult(final QueryResultMetaData queryResultMetaData, final Iterator<QueryRow> resultData, final AggregationDistinctQueryMetaData distinctQueryMetaData);  AggregationDistinctQueryResult(final Collection<QueryResult> queryResults, final List<AggregationDistinctSelectItem> aggregationDistinctSelectItems); }
AggregationDistinctQueryResult extends DistinctQueryResult { @Override public List<DistinctQueryResult> divide() { return Lists.newArrayList(Iterators.transform(getResultData(), new Function<QueryRow, DistinctQueryResult>() { @Override public DistinctQueryResult apply(final QueryRow input) { Set<QueryRow> resultData = new LinkedHashSet<>(); resultData.add(input); return new AggregationDistinctQueryResult(getQueryResultMetaData(), resultData.iterator(), metaData); } })); } private  AggregationDistinctQueryResult(final QueryResultMetaData queryResultMetaData, final Iterator<QueryRow> resultData, final AggregationDistinctQueryMetaData distinctQueryMetaData);  AggregationDistinctQueryResult(final Collection<QueryResult> queryResults, final List<AggregationDistinctSelectItem> aggregationDistinctSelectItems); @Override List<DistinctQueryResult> divide(); @Override Object getValue(final int columnIndex, final Class<?> type); @Override Object getValue(final String columnLabel, final Class<?> type); @Override Object getCalendarValue(final int columnIndex, final Class<?> type, final Calendar calendar); @Override Object getCalendarValue(final String columnLabel, final Class<?> type, final Calendar calendar); @Override InputStream getInputStream(final int columnIndex, final String type); @Override InputStream getInputStream(final String columnLabel, final String type); @Override boolean wasNull(); @Override String getColumnLabel(final int columnIndex); }
AggregationDistinctQueryResult extends DistinctQueryResult { @Override public List<DistinctQueryResult> divide() { return Lists.newArrayList(Iterators.transform(getResultData(), new Function<QueryRow, DistinctQueryResult>() { @Override public DistinctQueryResult apply(final QueryRow input) { Set<QueryRow> resultData = new LinkedHashSet<>(); resultData.add(input); return new AggregationDistinctQueryResult(getQueryResultMetaData(), resultData.iterator(), metaData); } })); } private  AggregationDistinctQueryResult(final QueryResultMetaData queryResultMetaData, final Iterator<QueryRow> resultData, final AggregationDistinctQueryMetaData distinctQueryMetaData);  AggregationDistinctQueryResult(final Collection<QueryResult> queryResults, final List<AggregationDistinctSelectItem> aggregationDistinctSelectItems); @Override List<DistinctQueryResult> divide(); @Override Object getValue(final int columnIndex, final Class<?> type); @Override Object getValue(final String columnLabel, final Class<?> type); @Override Object getCalendarValue(final int columnIndex, final Class<?> type, final Calendar calendar); @Override Object getCalendarValue(final String columnLabel, final Class<?> type, final Calendar calendar); @Override InputStream getInputStream(final int columnIndex, final String type); @Override InputStream getInputStream(final String columnLabel, final String type); @Override boolean wasNull(); @Override String getColumnLabel(final int columnIndex);  }