### Question:
OperationFuture extends CompletableFuture<CruiseControlResponse> { public synchronized boolean setExecutionThread(Thread t) { if (isCancelled() && t != null) { return false; } else { _executionThread = t; return true; } } OperationFuture(String operation); @Override synchronized boolean cancel(boolean mayInterruptIfRunning); @Override CruiseControlResponse get(); String operation(); synchronized boolean setExecutionThread(Thread t); String progressString(); Map<String, Object> getJsonStructure(); OperationProgress operationProgress(); void setFinishTimeNs(long finishTimeNs); long finishTimeNs();  }### Answer:
@Test public void testSetExecutionThread() { OperationFuture future = new OperationFuture("testSetExecutionThread"); assertTrue(future.setExecutionThread(new Thread())); future.cancel(true); assertTrue("Should be able to set the execution thread of canceled future to null", future.setExecutionThread(null)); assertFalse("Should failed to set execution thread for the canceled future.", future.setExecutionThread(new Thread())); }