public static <T> T objectify(ObjectMapper mapper, Object source, JavaType targetType) {
        try {
            return mapper.readValue(mapper.writeValueAsBytes(source), targetType);
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
public static < T > T objectify ( ObjectMapper mapper , Object source , JavaType targetType ) { try { return mapper . readValue ( mapper . writeValueAsBytes ( source ) , targetType ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Converts an object to an instance of the target type.

@param mapper     the object mapper
@param source     the source to convert
@param targetType the target class type
@return target instance
@see SquigglyUtils#objectify(ObjectMapper, Object, Class)