@Test
public void testDuplicateChannel() throws InvalidArgumentException {

    thrown.expect(InvalidArgumentException.class);
    thrown.expectMessage("Can not add peer " + PEER_NAME + " to channel duplicate because it already belongs to channel duplicate.");
    Channel duplicate = hfclient.newChannel("duplicate");
    peer.setChannel(duplicate);
    peer.setChannel(duplicate);
}