GafferCoprocessor extends BaseRegionObserver { @Override public RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e, final Scan scan, final RegionScanner scanner) throws IOException { return new QueryScanner(scanner, scan, schema, serialisation); }  @Override void start(final CoprocessorEnvironment e); @Override InternalScanner preFlush(final ObserverContext<RegionCoprocessorEnvironment> e,
                                    final Store store,
                                    final InternalScanner scanner); @Override InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e,
                                      final Store store,
                                      final InternalScanner scanner,
                                      final ScanType scanType,
                                      final CompactionRequest request); @Override InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e,
                                      final Store store,
                                      final InternalScanner scanner,
                                      final ScanType scanType); @Override RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e, final Scan scan, final RegionScanner scanner);  }
@Test public void shouldDelegatePostScannerOpenToQueryScanner() throws IOException { final ObserverContext<RegionCoprocessorEnvironment> e = mock(ObserverContext.class); final Scan scan = mock(Scan.class); final RegionScanner scanner = mock(RegionScanner.class); final QueryScanner queryScanner = (QueryScanner) coprocessor.postScannerOpen(e, scan, scanner); assertNotNull(queryScanner); }