### Question:
SubscriptionRequestMapper { public UnsubscribeRequest mapUnsubscribeRequest(final JsonRpcRequestContext jsonRpcRequestContext) throws InvalidSubscriptionRequestException { try { final WebSocketRpcRequest webSocketRpcRequestBody = validateRequest(jsonRpcRequestContext); final long subscriptionId = webSocketRpcRequestBody.getRequiredParameter(0, UnsignedLongParameter.class).getValue(); return new UnsubscribeRequest(subscriptionId, webSocketRpcRequestBody.getConnectionId()); } catch (final Exception e) { throw new InvalidSubscriptionRequestException("Error parsing unsubscribe request", e); } } SubscriptionRequestMapper(); SubscribeRequest mapSubscribeRequest(final JsonRpcRequestContext jsonRpcRequestContext); UnsubscribeRequest mapUnsubscribeRequest(final JsonRpcRequestContext jsonRpcRequestContext); PrivateSubscribeRequest mapPrivateSubscribeRequest(
      final JsonRpcRequestContext jsonRpcRequestContext, final String enclavePublicKey); PrivateUnsubscribeRequest mapPrivateUnsubscribeRequest(
      final JsonRpcRequestContext jsonRpcRequestContext);  }### Answer:
@Test public void mapRequestToUnsubscribeRequest() { final JsonRpcRequest jsonRpcRequest = parseWebSocketRpcRequest( "{\"id\": 1, \"method\": \"eth_unsubscribe\", \"params\": [\"0x1\"]}"); final UnsubscribeRequest expectedUnsubscribeRequest = new UnsubscribeRequest(1L, CONNECTION_ID); final UnsubscribeRequest unsubscribeRequest = mapper.mapUnsubscribeRequest(new JsonRpcRequestContext(jsonRpcRequest)); assertThat(unsubscribeRequest).isEqualTo(expectedUnsubscribeRequest); }
@Test public void mapRequestToUnsubscribeRequestIgnoresSecondParam() { final JsonRpcRequest jsonRpcRequest = parseWebSocketRpcRequest( "{\"id\": 1, \"method\": \"eth_unsubscribe\", \"params\": [\"0x1\", {\"foo\": \"bar\"}]}"); final UnsubscribeRequest expectedUnsubscribeRequest = new UnsubscribeRequest(1L, CONNECTION_ID); final UnsubscribeRequest unsubscribeRequest = mapper.mapUnsubscribeRequest(new JsonRpcRequestContext(jsonRpcRequest)); assertThat(unsubscribeRequest).isEqualTo(expectedUnsubscribeRequest); }