### Question:
PrivJsonRpcMethods extends PrivacyApiGroupJsonRpcMethods { @Override protected Map<String, JsonRpcMethod> create( final PrivacyController privacyController, final EnclavePublicKeyProvider enclavePublicKeyProvider) { final Map<String, JsonRpcMethod> RPC_METHODS = mapOf( new PrivCall(getBlockchainQueries(), privacyController, enclavePublicKeyProvider), new PrivDebugGetStateRoot( getBlockchainQueries(), enclavePublicKeyProvider, privacyController), new PrivDistributeRawTransaction( privacyController, enclavePublicKeyProvider, getPrivacyParameters().isOnchainPrivacyGroupsEnabled()), new PrivGetCode(getBlockchainQueries(), privacyController, enclavePublicKeyProvider), new PrivGetLogs( getBlockchainQueries(), getPrivacyQueries(), privacyController, enclavePublicKeyProvider), new PrivGetPrivateTransaction(privacyController, enclavePublicKeyProvider), new PrivGetPrivacyPrecompileAddress(getPrivacyParameters()), new PrivGetTransactionCount(privacyController, enclavePublicKeyProvider), new PrivGetTransactionReceipt( getPrivacyParameters().getPrivateStateStorage(), privacyController, enclavePublicKeyProvider), new PrivGetFilterLogs(filterManager, privacyController, enclavePublicKeyProvider), new PrivGetFilterChanges(filterManager, privacyController, enclavePublicKeyProvider), new PrivNewFilter(filterManager, privacyController, enclavePublicKeyProvider), new PrivUninstallFilter(filterManager, privacyController, enclavePublicKeyProvider)); if (!getPrivacyParameters().isOnchainPrivacyGroupsEnabled()) { final Map<String, JsonRpcMethod> OFFCHAIN_METHODS = mapOf( new PrivCreatePrivacyGroup(privacyController, enclavePublicKeyProvider), new PrivDeletePrivacyGroup(privacyController, enclavePublicKeyProvider), new PrivFindPrivacyGroup(privacyController, enclavePublicKeyProvider)); OFFCHAIN_METHODS.forEach( (key, jsonRpcMethod) -> RPC_METHODS.merge(key, jsonRpcMethod, (oldVal, newVal) -> newVal)); } return RPC_METHODS; } PrivJsonRpcMethods(
      final BlockchainQueries blockchainQueries,
      final ProtocolSchedule protocolSchedule,
      final TransactionPool transactionPool,
      final PrivacyParameters privacyParameters,
      final FilterManager filterManager);   }### Answer:
@Test public void offchainPrivacyGroupMethodsAreDisabledWhenOnchainPrivacyGroupIsEnabled() { when(privacyParameters.isOnchainPrivacyGroupsEnabled()).thenReturn(true); final Map<String, JsonRpcMethod> rpcMethods = privJsonRpcMethods.create(); assertThat(rpcMethods.get(PRIV_CREATE_PRIVACY_GROUP.getMethodName())).isNull(); assertThat(rpcMethods.get(PRIV_DELETE_PRIVACY_GROUP.getMethodName())).isNull(); assertThat(rpcMethods.get(PRIV_FIND_PRIVACY_GROUP.getMethodName())).isNull(); }
@Test public void offchainPrivacyGroupMethodsAreEnabledWhenOnchainPrivacyGroupIsDisabled() { when(privacyParameters.isOnchainPrivacyGroupsEnabled()).thenReturn(false); final Map<String, JsonRpcMethod> rpcMethods = privJsonRpcMethods.create(); assertThat(rpcMethods.get(PRIV_CREATE_PRIVACY_GROUP.getMethodName())).isNotNull(); assertThat(rpcMethods.get(PRIV_DELETE_PRIVACY_GROUP.getMethodName())).isNotNull(); assertThat(rpcMethods.get(PRIV_FIND_PRIVACY_GROUP.getMethodName())).isNotNull(); }