class TypeTransformerFactory {

    public TypeTransformer getTransformer(Class<?> targetClass) {
        TypeTransformer normaliser = transformers.get(targetClass);

        if (normaliser == null) {
            Class<?> bestCandidate = findClosestAncestor(targetClass);

            if (bestCandidate != null) {
                normaliser = transformers.get(bestCandidate);
                transformers.put(targetClass, normaliser);
            }
        }

        return normaliser;
    }

}