RequestBuilder { public RequestBuilder withTimeout( int timeout ) { Preconditions.checkArgument( NumUtil.isIntBetween( timeout, Common.MIN_COMMAND_TIMEOUT_SEC, Common.MAX_COMMAND_TIMEOUT_SEC ), String.format( "Timeout is not in range %d to %d", Common.MIN_COMMAND_TIMEOUT_SEC, Common.MAX_COMMAND_TIMEOUT_SEC ) ); this.timeout = timeout; return this; } RequestBuilder( @JsonProperty( value = "command" ) final String command,
                           @JsonProperty( value = "cwd" ) final String cwd,
                           @JsonProperty( value = "type" ) final RequestType type,
                           @JsonProperty( value = "outputRedirection" ) final OutputRedirection outputRedirection,
                           @JsonProperty( value = "errRedirection" ) final OutputRedirection errRedirection,
                           @JsonProperty( value = "timeout" ) final Integer timeout,
                           @JsonProperty( value = "runAs" ) final String runAs,
                           @JsonProperty( value = "cmdArgs" ) final List<String> cmdArgs,
                           @JsonProperty( value = "envVars" ) final Map<String, String> envVars,
                           @JsonProperty( value = "isDaemon" ) final int isDaemon );  RequestBuilder( String command ); Integer getTimeout(); RequestBuilder withCwd( String cwd ); RequestBuilder withType( RequestType type ); RequestBuilder withStdOutRedirection( OutputRedirection outputRedirection ); RequestBuilder withStdErrRedirection( OutputRedirection errRedirection ); RequestBuilder withTimeout( int timeout ); RequestBuilder withRunAs( String runAs ); RequestBuilder withCmdArgs( String... cmdArgs ); RequestBuilder withEnvVars( Map<String, String> envVars ); RequestBuilder daemon(); Request build( String id ); @Override boolean equals( final Object o ); @Override int hashCode();  }
@Test public void testWithTimeout() throws Exception { requestBuilder.withTimeout( 500 ); }