@Test
  public void testAccessControlServices() {
    MasterCoprocessor defaultImpl = new AccessController();
    MasterCoprocessor customImpl = new MockAccessController();
    MasterCoprocessor unrelatedImpl = new JMXListener();
    assertTrue(masterServices.checkCoprocessorWithService(Collections.singletonList(defaultImpl),
      AccessControlService.Interface.class));
    assertTrue(masterServices.checkCoprocessorWithService(Collections.singletonList(customImpl),
      AccessControlService.Interface.class));
    assertFalse(masterServices.checkCoprocessorWithService(Collections.emptyList(),
      AccessControlService.Interface.class));
    assertFalse(
      masterServices.checkCoprocessorWithService(null, AccessControlService.Interface.class));
    assertFalse(masterServices.checkCoprocessorWithService(Collections.singletonList(unrelatedImpl),
      AccessControlService.Interface.class));
    assertTrue(masterServices.checkCoprocessorWithService(Arrays.asList(unrelatedImpl, customImpl),
      AccessControlService.Interface.class));
    assertTrue(masterServices.checkCoprocessorWithService(Arrays.asList(unrelatedImpl, defaultImpl),
      AccessControlService.Interface.class));
  }
Tests that the MasterRpcServices is correctly searching for implementations of the Coprocessor
Service and not just the "default" implementations of those services.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterCoprocessorServices.java