### Question:
NodeLocalConfigPermissioningController implements NodePermissioningProvider { public NodesAllowlistResult addNodes(final List<String> enodeURLs) { final NodesAllowlistResult inputValidationResult = validInput(enodeURLs); if (inputValidationResult.result() != AllowlistOperationResult.SUCCESS) { return inputValidationResult; } final List<EnodeURL> peers = enodeURLs.stream() .map(url -> EnodeURL.fromString(url, configuration.getEnodeDnsConfiguration())) .collect(Collectors.toList()); for (EnodeURL peer : peers) { if (nodesAllowlist.contains(peer)) { return new NodesAllowlistResult( AllowlistOperationResult.ERROR_EXISTING_ENTRY, String.format("Specified peer: %s already exists in allowlist.", peer.getNodeId())); } } final List<EnodeURL> oldAllowlist = new ArrayList<>(this.nodesAllowlist); peers.forEach(this::addNode); notifyListUpdatedSubscribers(new NodeAllowlistUpdatedEvent(peers, Collections.emptyList())); final NodesAllowlistResult updateConfigFileResult = updateAllowlistInConfigFile(oldAllowlist); if (updateConfigFileResult.result() != AllowlistOperationResult.SUCCESS) { return updateConfigFileResult; } return new NodesAllowlistResult(AllowlistOperationResult.SUCCESS); } NodeLocalConfigPermissioningController(
      final LocalPermissioningConfiguration permissioningConfiguration,
      final List<EnodeURL> fixedNodes,
      final Bytes localNodeId,
      final MetricsSystem metricsSystem);  NodeLocalConfigPermissioningController(
      final LocalPermissioningConfiguration configuration,
      final List<EnodeURL> fixedNodes,
      final Bytes localNodeId,
      final AllowlistPersistor allowlistPersistor,
      final MetricsSystem metricsSystem); NodesAllowlistResult addNodes(final List<String> enodeURLs); boolean addNode(final EnodeURL enodeURL); NodesAllowlistResult removeNodes(final List<String> enodeURLs); boolean isPermitted(final String enodeURL); boolean isPermitted(final EnodeURL node); List<String> getNodesAllowlist(); synchronized void reload(); long subscribeToListUpdatedEvent(final Consumer<NodeAllowlistUpdatedEvent> subscriber); @Override boolean isPermitted(final EnodeURL sourceEnode, final EnodeURL destinationEnode);  }### Answer:
@Test public void whenAddNodesInputHasExistingNodeShouldReturnAddErrorExistingEntry() { controller.addNodes(Arrays.asList(enode1)); NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_EXISTING_ENTRY); NodesAllowlistResult actualResult = controller.addNodes(Lists.newArrayList(enode1, enode2)); assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result"); }
@Test public void whenAddNodesInputHasDuplicatedNodesShouldReturnDuplicatedEntryError() { NodesAllowlistResult expected = new NodesAllowlistResult(AllowlistOperationResult.ERROR_DUPLICATED_ENTRY); NodesAllowlistResult actualResult = controller.addNodes(Arrays.asList(enode1, enode1)); assertThat(actualResult).isEqualToComparingOnlyGivenFields(expected, "result"); }