    @Test
    public void testCommand_timeout() {

        when(shell.open()).thenReturn(Single.just(shellSession));

        when(shellSession.submit(any(Cmd.class))).thenAnswer(invocation -> Single.just(new Cmd.Result(invocation.getArgument(0), Cmd.ExitCode.TIMEOUT, new ArrayList<>(), new ArrayList<>())));
        Root.Builder builder = new Root.Builder().timeout(1000);
        assertThat(builder.shellBuilder(shellBuilder).suBinary(suBinary).build().blockingGet().getState(), is(Root.State.DENIED));

        when(shellSession.submit(any(Cmd.class))).thenAnswer(invocation -> {
            Cmd cmd = invocation.getArgument(0);
            return Single.just(new Cmd.Result(cmd, Cmd.ExitCode.OK, Collections.singletonList("uid=0(root) gid=0(root) groups=0(root) context=u:r:supersu:s0"), new ArrayList<>()));
        });
        builder = new Root.Builder();
        assertThat(builder.shellBuilder(shellBuilder).suBinary(suBinary).build().blockingGet().getState(), is(Root.State.ROOTED));
    }