### Question:
OutboundQueueEntry { boolean complete(final OfHeader response) { Preconditions.checkState(!completed, "Attempted to complete a completed message with response %s", response); final boolean reallyComplete = isCompletedFunction.apply(response); completed = reallyComplete; if (callback != null) { callback.onSuccess(response); if (reallyComplete) { callback = null; } } LOG.debug("Entry {} completed {} with response {}", this, completed, response); return reallyComplete; }   static final Function<OfHeader, Boolean> DEFAULT_IS_COMPLETE; }### Answer:
@Test public void complete() throws Exception { final boolean result = outboundQueueEntry.complete(multipartReplyMessage); Assert.assertTrue(result); Assert.assertTrue(outboundQueueEntry.isCompleted()); }
@Test(expected = IllegalStateException.class) public void completeTwice() throws Exception { outboundQueueEntry.complete(multipartReplyMessage); outboundQueueEntry.complete(multipartReplyMessage); }