public void failOnDuplicate(Object result, ClassMap classMap) {
        if (result != null && !classMap.getSrcClassName().equals(classMap.getDestClassName())) {
            throw new IllegalArgumentException("Duplicate Class Mapping Found. Source: " + classMap.getSrcClassName()
                                               + " Destination: " + classMap.getDestClassName() + " map-id: " + classMap.getMapId());
        }
    }
Internal class that determines the appropriate class mapping to be used for
the source and destination object being mapped. Only intended for internal
use.
core/src/main/java/com/github/dozermapper/core/classmap/ClassMappings.java