@Test void convertToUnsupportedType() { ConversionException conversionException = assertThrows(ConversionException.class, () -> { documentConverter.convert(Integer.class, this.document); }); assertEquals("Unsupported target type [class java.lang.Integer]", conversionException.getMessage()); }
@Override public <G> G convert(Type targetType, Object sourceValue) { if (sourceValue == null) { return null; } if (sourceValue instanceof Document) { return convertFromType(targetType, sourceValue); } else { return super.convert(targetType, sourceValue); } }
DocumentConverter extends AbstractConverter<Document> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (sourceValue == null) { return null; } if (sourceValue instanceof Document) { return convertFromType(targetType, sourceValue); } else { return super.convert(targetType, sourceValue); } } }
DocumentConverter extends AbstractConverter<Document> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (sourceValue == null) { return null; } if (sourceValue instanceof Document) { return convertFromType(targetType, sourceValue); } else { return super.convert(targetType, sourceValue); } }  }
DocumentConverter extends AbstractConverter<Document> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (sourceValue == null) { return null; } if (sourceValue instanceof Document) { return convertFromType(targetType, sourceValue); } else { return super.convert(targetType, sourceValue); } }  @Override G convert(Type targetType, Object sourceValue); @Override Document convertToType(Type targetType, Object sourceValue); }
DocumentConverter extends AbstractConverter<Document> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (sourceValue == null) { return null; } if (sourceValue instanceof Document) { return convertFromType(targetType, sourceValue); } else { return super.convert(targetType, sourceValue); } }  @Override G convert(Type targetType, Object sourceValue); @Override Document convertToType(Type targetType, Object sourceValue);  }