Source:
<code>public Builder<ChannelFactory> configure(OperationContext context, ModelNode model) throws OperationFailedException { this.statisticsEnabled = StackResourceDefinition.Attribute.STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean(); Resource resource = context.readResourceFromRoot(this.address, false); <START> Optional<PathElement> transport = Optional.empty(); <END> for (Resource.ResourceEntry resourceEntry : resource.getChildren(TransportResourceDefinition.WILDCARD_PATH.getKey())) { PathElement pathElement = resourceEntry.getPathElement(); transport = Optional.of(pathElement); break; } if (!transport.isPresent()) { throw JGroupsLogger.ROOT_LOGGER.transportNotDefined(this.getName()); } this.transport = new InjectedValueDependency<>(new SingletonProtocolServiceNameProvider(this.address, transport.get()), TransportConfiguration.class); List<ValueDependency<ProtocolConfiguration>> list = new ArrayList<>(); for (Resource.ResourceEntry entry : resource.getChildren(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { InjectedValueDependency<ProtocolConfiguration> protocolConfigurationInjectedValueDependency = new InjectedValueDependency<>(new ProtocolServiceNameProvider(this.address, entry.getPathElement()), ProtocolConfiguration.class); list.add(protocolConfigurationInjectedValueDependency); } this.protocols = list; this.relay = resource.hasChild(RelayResourceDefinition.PATH) ? new InjectedValueDependency<>(new SingletonProtocolServiceNameProvider(this.address, RelayResourceDefinition.PATH), RelayConfiguration.class) : null; return this; }</code><technical_language>of Optional is superfluous</technical_language>

Target:
public Builder<ChannelFactory> configure(OperationContext context, ModelNode model) throws OperationFailedException { this.statisticsEnabled = StackResourceDefinition.Attribute.STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean(); Resource resource = context.readResourceFromRoot(this.address, false); Iterator<Resource.ResourceEntry> iterator = resource.getChildren(TransportResourceDefinition.WILDCARD_PATH.getKey()).iterator(); if (! iterator.hasNext()) { throw JGroupsLogger.ROOT_LOGGER.transportNotDefined(this.getName()); } PathElement transport = iterator.next().getPathElement(); this.transport = new InjectedValueDependency<>(new SingletonProtocolServiceNameProvider(this.address, transport), TransportConfiguration.class); final Set<Resource.ResourceEntry> entries = resource.getChildren(ProtocolResourceDefinition.WILDCARD_PATH.getKey()); final List<ValueDependency<ProtocolConfiguration>> list = new ArrayList<>(entries.size()); for (Resource.ResourceEntry entry : entries) { InjectedValueDependency<ProtocolConfiguration> protocolConfigurationInjectedValueDependency = new InjectedValueDependency<>(new ProtocolServiceNameProvider(this.address, entry.getPathElement()), ProtocolConfiguration.class); list.add(protocolConfigurationInjectedValueDependency); } this.protocols = list; this.relay = resource.hasChild(RelayResourceDefinition.PATH) ? new InjectedValueDependency<>(new SingletonProtocolServiceNameProvider(this.address, RelayResourceDefinition.PATH), RelayConfiguration.class) : null; return this; }