### Question:
DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> allow(final T context) { throw new IllegalStateException(ILLEGAL_ALLOW_MESSAGE); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandResult<V> execute(final T context); @Override boolean isUndoReverse();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testAllow() { compositeCommand = buildCompositeCommand(); expectedException.expectMessage(DeferredCompositeCommand.ILLEGAL_ALLOW_MESSAGE); compositeCommand.allow(commandExecutionContext); }