RpcMessage(int xid, Type messageType) {
    if (messageType != Type.RPC_CALL && messageType != Type.RPC_REPLY) {
      throw new IllegalArgumentException("Invalid message type " + messageType);
    }
    this.xid = xid;
    this.messageType = messageType;
  }
@Test
  public void testRpcMessage() {
    RpcMessage msg = getRpcMessage(0, RpcMessage.Type.RPC_CALL);
    Assert.assertEquals(0, msg.getXid());
    Assert.assertEquals(RpcMessage.Type.RPC_CALL, msg.getMessageType());
  }