@Test
@SuppressWarnings("unchecked")
public void executeCommandTestDealingWithInterruptedException() throws IOException, InterruptedException {

    spy.logger = Mockito.mock(Logger.class);
    Process processMock = Mockito.mock(Process.class);
    Runtime runtimeMock = configureAndGetRuntimeMock();
    Mockito.when(runtimeMock.exec(command)).thenReturn(processMock);
    Mockito.when(processMock.waitFor()).thenThrow(InterruptedException.class);
    String commandOutput = spy.executeCommand(command);
    Mockito.verify(processMock).waitFor();
    executeChecksForExceptionTests(commandOutput, InterruptedException.class);
}