@Test
  public void testGetSetRemoveCP() throws Exception {
    // simple CP
    String className = "org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver";
    TableDescriptor desc = TableDescriptorBuilder
      .newBuilder(TableName.valueOf(name.getMethodName())).setCoprocessor(className) // add and
                                                                                     // check that
                                                                                     // it is
                                                                                     // present
      .build();
    assertTrue(desc.hasCoprocessor(className));
    desc = TableDescriptorBuilder.newBuilder(desc).removeCoprocessor(className) // remove it and
                                                                                // check that it is
                                                                                // gone
      .build();
    assertFalse(desc.hasCoprocessor(className));
  }
Test cps in the table description.
@throws Exception if setting a coprocessor fails
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestTableDescriptorBuilder.java