BlockingCommandCallback implements CommandCallback { public CommandResult getCommandResult() { try { completionSemaphore.acquire(); } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); } return commandResult; } BlockingCommandCallback( CommandCallback callback ); @Override void onResponse( final Response response, final CommandResult commandResult ); Semaphore getCompletionSemaphore(); CommandResult getCommandResult();  }
@Test public void testGetCommandResult() throws Exception { blockingCommandCallback.completionSemaphore = completionSemaphore; blockingCommandCallback.getCommandResult(); verify( completionSemaphore ).acquire(); }