private ObjectInfoProvider getInfoAppender(final Class<?> type) {
        if (type == null) {
            return null;
        }
        ObjectInfoProvider appender = null;

        if (String.class.equals(type)) {
            appender = new ObjectInfoProvider() {
                @Override
                public BaseObject createBaseObject(final Object object) {
                    return OtherObject.builder()
                            .withType(object.toString())
                            .build();
                }

                @Override
                public String getObjectType(final Object object) {
                    return object.toString();
                }
            };
        } else {
            // Some providers exist for superclasses and not subclass types so keep looking through the
            // class hierarchy to find a provider.
            Class<?> currentType = type;
            Provider<ObjectInfoProvider> provider = null;
            while (currentType != null && provider == null) {
                provider = objectInfoProviderMap.get(new ObjectType(currentType));
                currentType = currentType.getSuperclass();
            }

            if (provider != null) {
                appender = provider.get();
            }
        }

        if (appender == null) {
            LOGGER.debug("No ObjectInfoProvider found for " + type.getName());
        }

        return appender;
    }
Shallow merge of the two Purpose objects
stroom-event-logging/stroom-event-logging-impl/src/main/java/stroom/event/logging/impl/StroomEventLoggingServiceImpl.java