@Test public void testSelectQueries() { FinishedLensQuery mockFinishedQuery = mock(FinishedLensQuery.class); EstimatedImmutableQueryCollection mockWaitingQueries = mock(EstimatedImmutableQueryCollection.class); LensDriver mockSelectedDriver = mock(LensDriver.class); Set expectedQueriesSet = mock(Set.class); when(mockFinishedQuery.getSelectedDriver()).thenReturn(mockSelectedDriver); when(mockWaitingQueries.getQueries(mockSelectedDriver)).thenReturn(expectedQueriesSet); WaitingQueriesSelectionPolicy selectionPolicy = new DriverSpecificWaitingQueriesSelectionPolicy(); Set actualEligibleQueries = selectionPolicy.selectQueries(mockFinishedQuery, mockWaitingQueries); assertEquals(actualEligibleQueries, expectedQueriesSet); }
@Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { LensDriver selectedDriver = finishedQuery.getSelectedDriver(); return waitingQueries.getQueries(selectedDriver); }
DriverSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { LensDriver selectedDriver = finishedQuery.getSelectedDriver(); return waitingQueries.getQueries(selectedDriver); } }
DriverSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { LensDriver selectedDriver = finishedQuery.getSelectedDriver(); return waitingQueries.getQueries(selectedDriver); }  }
DriverSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { LensDriver selectedDriver = finishedQuery.getSelectedDriver(); return waitingQueries.getQueries(selectedDriver); }  @Override Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery,
      final EstimatedImmutableQueryCollection waitingQueries); }
DriverSpecificWaitingQueriesSelectionPolicy implements WaitingQueriesSelectionPolicy { @Override public Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery, final EstimatedImmutableQueryCollection waitingQueries) { LensDriver selectedDriver = finishedQuery.getSelectedDriver(); return waitingQueries.getQueries(selectedDriver); }  @Override Set<QueryContext> selectQueries(final FinishedLensQuery finishedQuery,
      final EstimatedImmutableQueryCollection waitingQueries);  }