@Test
public void Should_handleThreadInterruption()
        throws Exception {

    DirectoryStream directoryStreamMock = mock(DirectoryStream.class);
    Iterator directoryStreamIteratorMock = mock(Iterator.class);
    when(directoryStreamIteratorMock.hasNext()).thenReturn(false);
    when(directoryStreamMock.iterator()).thenReturn(directoryStreamIteratorMock);
    when(fileSystemProviderMock.newDirectoryStream(any(), any())).thenReturn(directoryStreamMock);
    when(watchServiceMock.take()).thenThrow(new InterruptedException());
    ListenerTask task = new ListenerTask(directoryMock, actionMock, fileSystemMock);
    task.run();
    assertTrue(Thread.interrupted());
}