### Question:
RpcException extends Exception { @Override public String toString() { return "RpcException{" + "rpcError=" + rpcError + '}'; } RpcException(RpcError rpcError); RpcError getRpcError(); @Override String toString();  }### Answer:
@Test public void testConstructorAndToStringNotCrashing() { new RpcException(new RpcError(1, "message")).toString(); }
@Test public void testStoresRpcError() { var error = new RpcError(1, "msg"); assertThat(new RpcException(error).toString(), new BaseMatcher<>() { @Override public boolean matches(Object o) { return o.toString().contains("msg"); } @Override public void describeTo(Description description) { description.appendText("Contains rpcerror"); } }); }