@SuppressWarnings("unchecked")
  private <T> T transform(Class<T> resultType, Object input, TransformerContext context) {
    Objects.requireNonNull(resultType, "No result type specified");
    Objects.requireNonNull(input, "No input specified");
    TransformKey key = new TransformKey(input.getClass(), resultType);
    BiFunction<Object, TransformerContext, T> function =
        (BiFunction<Object, TransformerContext, T>)
            cache.computeIfAbsent(
                key,
                v -> {
                  throw new IllegalArgumentException(
                      "Unsupported transformation: "
                          + input.getClass().getName()
                          + ":"
                          + resultType);
                });
    return function.apply(input, context);
  }
Dispatches to a cached function based on input and result types to perform a transformation.
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/transformer/TransformerServiceImpl.java