code: public static void check(final Object result, final Class<?> targetType) {
          if (result != null && !targetType.isAssignableFrom(result.getClass())) {
              // note: conversion logic may go wrong (e.g. because converter expect collection input mostly and may
              // not work correctly for single element), but anyway overall conversion would be considered failed.
              throw new ResultConversionException(String.format("Failed to convert %s to %s",
                      toStringType(result), targetType.getSimpleName()));
          }
      }
docs: Check converted result compatibility with required type.
  
  @param result     result object
  @param targetType target type
  @throws ResultConversionException if result doesn't match required type