### Question:
ExtractScreenshotFunction extends AbstractFunction { @Override protected Object execute(List<Object> arguments) { return Optional.ofNullable((AbstractTestDataEntity) arguments.get(0)) .map(entity -> screenshotDivConverter.convert(entity.getException())) .orElse(null); } ExtractScreenshotFunction(ScreenshotDivConverter screenshotDivConverter); @Override String name();  }### Answer:
@Test public void testExecute() throws Exception { assertNull(new ExtractScreenshotFunction(converter).execute(Collections.singletonList(null))); verify(converter, never()).convert(any()); }
@Test public void testExecuteNoExeception() throws Exception { AbstractTestDataEntity entity = mock(AbstractTestDataEntity.class); when(entity.getException()).thenReturn(null); assertNull(new ExtractScreenshotFunction(converter).execute(Collections.singletonList(entity))); verify(converter).convert(any()); }