### Question:
ResultMessage extends WampMessage { public static ResultMessage deserialize(JsonParser jp) throws IOException { jp.nextToken(); long request = jp.getLongValue(); jp.nextToken(); ParserUtil.readObject(jp); List<Object> arguments = null; JsonToken token = jp.nextToken(); if (token == JsonToken.START_ARRAY) { arguments = ParserUtil.readArray(jp); } Map<String, Object> argumentsKw = null; token = jp.nextToken(); if (token == JsonToken.START_OBJECT) { argumentsKw = ParserUtil.readObject(jp); } return new ResultMessage(request, arguments, argumentsKw); } ResultMessage(long requestId, @Nullable List<Object> arguments,
			@Nullable Map<String, Object> argumentsKw);  ResultMessage(CallMessage callMessage, @Nullable List<Object> arguments,
			@Nullable Map<String, Object> argumentsKw);  ResultMessage(YieldMessage yieldMessage, CallMessage callMessage); static ResultMessage deserialize(JsonParser jp); @Override void serialize(JsonGenerator generator); long getRequestId(); @Nullable List<Object> getArguments(); @Nullable Map<String, Object> getArgumentsKw(); @Override String toString(); final long requestId; }### Answer:
@Test public void deserializeTest() throws IOException { String json = "[50, 7814135, {}]"; ResultMessage resultMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(resultMessage.getCode()).isEqualTo(50); assertThat(resultMessage.getRequestId()).isEqualTo(7814135L); assertThat(resultMessage.getArguments()).isNull(); assertThat(resultMessage.getArgumentsKw()).isNull(); json = "[50, 7814135, {}, [\"Hello, world!\"]]"; resultMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(resultMessage.getCode()).isEqualTo(50); assertThat(resultMessage.getRequestId()).isEqualTo(7814135L); assertThat(resultMessage.getArguments()).containsExactly("Hello, world!"); assertThat(resultMessage.getArgumentsKw()).isNull(); json = "[50, 7814135, {}, [30]]"; resultMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(resultMessage.getCode()).isEqualTo(50); assertThat(resultMessage.getRequestId()).isEqualTo(7814135L); assertThat(resultMessage.getArguments()).containsExactly(30); assertThat(resultMessage.getArgumentsKw()).isNull(); json = "[50, 7814135, {}, [], {\"userid\": 123, \"karma\": 10}]"; resultMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(resultMessage.getCode()).isEqualTo(50); assertThat(resultMessage.getRequestId()).isEqualTo(7814135L); assertThat(resultMessage.getArguments()).isEmpty(); assertThat(resultMessage.getArgumentsKw()) .containsOnly(MapEntry.entry("userid", 123), MapEntry.entry("karma", 10)); json = "[50, 7814135, {}, [\"a\",\"b\",\"c\"], {\"userid\": 123, \"karma\": 10}]"; resultMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(resultMessage.getCode()).isEqualTo(50); assertThat(resultMessage.getRequestId()).isEqualTo(7814135L); assertThat(resultMessage.getArguments()).containsExactly("a", "b", "c"); assertThat(resultMessage.getArgumentsKw()) .containsOnly(MapEntry.entry("userid", 123), MapEntry.entry("karma", 10)); }