@Test
  public void testClusterKeyWithTrailingSpace() throws Exception {
    admin.addReplicationPeer(ID_ONE,
      ReplicationPeerConfig.newBuilder().setClusterKey(KEY_ONE + " ").build()).get();
    String clusterKey = admin.getReplicationPeerConfig(ID_ONE).get().getClusterKey();
    assertEquals(KEY_ONE, clusterKey);
  }
Class to test asynchronous replication admin operations.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApi.java