private Device getClient(final HttpServletRequest request) {
        final Device device;
        if (request != null) {
            // First try and use the X-FORWARDED-FOR header that provides the originating
            // IP address of the request if behind a proxy.
            final String address = getIpFromXForwardedFor(request)
                    .orElseGet(request::getRemoteAddr);

            device = copyDevice(deviceCache.getDeviceForIpAddress(address));

            LOGGER.debug(() -> LogUtil.message("Device - (host: {}, ip: {}, mac: {})",
                    device.getHostName(),
                    device.getIPAddress(),
                    device.getMACAddress()));
        } else {
            device = null;
        }
        return device;
    }
Shallow merge of the two Purpose objects
stroom-event-logging/stroom-event-logging-impl/src/main/java/stroom/event/logging/impl/StroomEventLoggingServiceImpl.java