DefaultCommandFuture implements CommandFuture<V> { @Override public String toString() { String resultDesc = null; if(isDone()){ if(isSuccess()){ resultDesc = String.format("success:%s", result); }else { resultDesc = String.format("fail:%s", cause()); } }else { resultDesc = "undone"; } return String.format("cmd:%s, %s", command, resultDesc); } DefaultCommandFuture();  DefaultCommandFuture(Command<V> command); @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override boolean isDone(); @Override CommandFuture<V> sync(); @Override V get(); @SuppressWarnings("unchecked") @Override V getNow(); @Override V get(long timeout, TimeUnit unit); @Override boolean isSuccess(); @Override Throwable cause(); @Override void setSuccess(); @Override void setSuccess(V result); @Override void setFailure(Throwable cause); @Override Future<V> await(); @Override boolean await(long timeout, TimeUnit unit); @Override void addListener(CommandFutureListener<V> commandFutureListener); @Override Command<V> command(); @Override String toString();  }
@Test public void testToString(){ jobFuture.setSuccess(); logger.info("{}", jobFuture); jobFuture = new DefaultCommandFuture<>(null); jobFuture.setFailure(new Exception("some exception")); logger.info("{}", jobFuture); }