### Question:
PrivxJsonRpcMethods extends PrivacyApiGroupJsonRpcMethods { @Override protected Map<String, JsonRpcMethod> create( final PrivacyController privacyController, final EnclavePublicKeyProvider enclavePublicKeyProvider) { if (getPrivacyParameters().isOnchainPrivacyGroupsEnabled()) { return mapOf(new PrivxFindOnChainPrivacyGroup(privacyController, enclavePublicKeyProvider)); } else { return Map.of(); } } PrivxJsonRpcMethods(
      final BlockchainQueries blockchainQueries,
      final ProtocolSchedule protocolSchedule,
      final TransactionPool transactionPool,
      final PrivacyParameters privacyParameters);   }### Answer:
@Test public void privxFindPrivacyGroupMethodIsDisabledWhenOnchainPrivacyGroupIsDisabled() { when(privacyParameters.isOnchainPrivacyGroupsEnabled()).thenReturn(false); final Map<String, JsonRpcMethod> rpcMethods = privxJsonRpcMethods.create(); final JsonRpcMethod method = rpcMethods.get(PRIVX_FIND_PRIVACY_GROUP.getMethodName()); assertThat(method).isNull(); }
@Test public void privxFindPrivacyGroupMethodIsEnabledWhenOnchainPrivacyGroupIsEnabled() { when(privacyParameters.isOnchainPrivacyGroupsEnabled()).thenReturn(true); final Map<String, JsonRpcMethod> rpcMethods = privxJsonRpcMethods.create(); final JsonRpcMethod method = rpcMethods.get(PRIVX_FIND_PRIVACY_GROUP.getMethodName()); assertThat(method).isNotNull(); assertThat(method).isInstanceOf(PrivxFindOnChainPrivacyGroup.class); }