CommandUtil { public void executeAsync( RequestBuilder requestBuilder, Host host, final StoppableCallback callback ) throws CommandException { Preconditions.checkNotNull( requestBuilder ); Preconditions.checkNotNull( host ); Preconditions.checkNotNull( callback ); host.executeAsync( requestBuilder, new CommandCallback() { @Override public void onResponse( final Response response, final CommandResult commandResult ) { if ( !callback.isStopped() ) { callback.onResponse( response, commandResult ); } } } ); }  CommandResult execute( RequestBuilder requestBuilder, Host host ); CommandResult execute( RequestBuilder requestBuilder, Host host, CommandCallback callback ); void executeAsync( RequestBuilder requestBuilder, Host host, final StoppableCallback callback ); void executeAsync( RequestBuilder requestBuilder, Set<Host> hosts, final CommandCallback callback ); Map<Host, CommandResult> executeSequential( RequestBuilder requestBuilder, Set<Host> hosts ); HostCommandResults execute( final RequestBuilder requestBuilder, Set<Host> hosts, String environmentId ); HostCommandResults executeFailFast( final RequestBuilder requestBuilder, Set<Host> hosts,
                                               String environmentId ); boolean cancelEnvironmentCommands( String environmentId ); void cancelAll(); void dispose();  }
@Test public void testExecuteAsync() throws Exception { commandUtil.executeAsync( requestBuilder, host, stoppableCallback ); }
@Test public void testExecuteAsync1() throws Exception { commandUtil.executeAsync( requestBuilder, mySet, commandCallback ); }