SetImageMappingsTask implements ReportParameterConfigurerTask { public static final SetImageMappingsTask newInstance( AbstractReportConfig reportConfig) { return new SetImageMappingsTask(() -> reportConfig .getReportImageResolver().get()); } SetImageMappingsTask(
			Supplier<ReportImageResolver> reportImageResolverSupplier); @Override Map<String, Object> configure(ReportProps reportProps,
			ReportFormat reportFormat, JRDataSource datasource); static final SetImageMappingsTask newInstance(
			AbstractReportConfig reportConfig);  }
@Test public void testNewInstance() { final AbstractReportConfig reportConfig = mock(AbstractReportConfig.class); when(reportConfig.getReportImageResolver()).thenReturn( Optional.of(reportImageResolver)); final SetImageMappingsTask newInstance = SetImageMappingsTask .newInstance(reportConfig); @SuppressWarnings("unchecked") final Supplier<ReportImageResolver> field = (Supplier<ReportImageResolver>) ReflectionTestUtils .getField(newInstance, "reportImageResolverSupplier"); assertEquals(reportImageResolver, field.get()); }