### Question:
WebSocketMethodsFactory { public Map<String, JsonRpcMethod> methods() { return methods; } WebSocketMethodsFactory(
      final SubscriptionManager subscriptionManager,
      final Map<String, JsonRpcMethod> jsonRpcMethods); Map<String, JsonRpcMethod> methods(); void addMethods(final JsonRpcMethod... rpcMethods);  }### Answer:
@Test public void websocketsFactoryShouldCreateEthSubscribe() { final JsonRpcMethod method = factory.methods().get("eth_subscribe"); assertThat(method).isNotNull(); assertThat(method).isInstanceOf(EthSubscribe.class); }
@Test public void websocketsFactoryShouldCreateEthUnsubscribe() { final JsonRpcMethod method = factory.methods().get("eth_unsubscribe"); assertThat(method).isNotNull(); assertThat(method).isInstanceOf(EthUnsubscribe.class); }
@Test public void factoryCreatesExpectedNumberOfMethods() { final Map<String, JsonRpcMethod> methodsMap = factory.methods(); assertThat(methodsMap).hasSize(2); }
@Test public void factoryIncludesJsonRpcMethodsWhenCreatingWebsocketMethods() { final JsonRpcMethod jsonRpcMethod1 = jsonRpcMethod(); final JsonRpcMethod jsonRpcMethod2 = jsonRpcMethod(); final Map<String, JsonRpcMethod> jsonRpcMethodsMap = new HashMap<>(); jsonRpcMethodsMap.put("method1", jsonRpcMethod1); jsonRpcMethodsMap.put("method2", jsonRpcMethod2); factory = new WebSocketMethodsFactory(subscriptionManager, jsonRpcMethodsMap); final Map<String, JsonRpcMethod> methods = factory.methods(); assertThat(methods).containsKeys("method1", "method2"); }