@Test
public void Should_wrapActionExceptionsIntoRuntimeExceptions()
        throws Exception {

    DirectoryStream directoryStreamMock = mock(DirectoryStream.class);
    Iterator directoryStreamIteratorMock = mock(Iterator.class);
    java.nio.file.Path[] filesMock = new java.nio.file.Path[] {
            mock(java.nio.file.Path.class)
    };
    when(directoryStreamIteratorMock.hasNext()).thenReturn(true, false);
    when(directoryStreamIteratorMock.next()).thenReturn(filesMock[0]);
    when(directoryStreamMock.iterator()).thenReturn(directoryStreamIteratorMock);
    when(fileSystemProviderMock.newDirectoryStream(any(), any())).thenReturn(directoryStreamMock);
    ListenerTask task = new ListenerTask(directoryMock, actionMock, fileSystemMock);
    doThrow(new ActionExecuteException("")).when(actionMock).execute(any(IPath.class));
    try {
        task.run();
        fail();
    } catch (RuntimeException e) {
        assertTrue(e.getCause() instanceof ActionExecuteException);
    }
}