@Test
public void testFinishedScan_invokeWithArgs() throws Exception {

    final Invocable delegate = mock(Invocable.class);
    final ScriptProgressCheck.ScriptHelper helper = new ScriptProgressCheck.ScriptHelper();
    final ScriptProgressCheck check = new ScriptProgressCheck(delegate, helper, null);
    final List<Map.Entry<String, Object[]>> argRecord = new ArrayList<>();
    doAnswer(call -> argRecord.add(toEntry(call.getArgument(0), call.getArguments())))
            .when(delegate).invokeFunction(anyString(), any());
    check.finishedScan();
    assertTrue("expect args for finishedScan", argRecord.stream()
            .anyMatch(entry -> "finishedScan".equals(entry.getKey()) && entry.getValue().length == 1));
}