@Test
public void testTimeouted() {

    try {
        // process never finish
        when(process.exitValue()).thenThrow(new IllegalThreadStateException());
        int exitCode = ProcessHelper.runWithTimeout(2, process);
        assertEquals(124, exitCode);
        verify(process, never()).waitFor();
        verify(process, times(1)).destroy();
    } catch (Exception e) {
        fail();
    }
}