class ResourceDescriptionAddressProcessor implements Function<ResourceAddress, ResourceAddress> {

    @Override
    public ResourceAddress apply(ResourceAddress address) {
        ResourceAddress modified = new ResourceAddress();

        if (address != null && !address.isEmpty()) {
            List<String[]> segments = address.asPropertyList().stream()
                    .map(property -> new String[]{property.getName(), property.getValue().asString()})
                    .collect(toList());
            SegmentProcessor.process(segments, segment -> modified.add(segment[0], segment[1]));
        }

        return modified;
    }

}