### Question:
InverseSpecification implements Specification { @Override public boolean isSatisfiedBy(Object request) { return !this.inner.isSatisfiedBy(request); } InverseSpecification(Specification inner); @Override boolean isSatisfiedBy(Object request);  }### Answer:
@Test public void returns_false_if_inner_specification_returns_true() { when(this.mockInnerSpecification.isSatisfiedBy(this.request)).thenReturn(true); boolean isSatisfied = this.specification.isSatisfiedBy(this.request); assertFalse(isSatisfied); }
@Test public void returns_true_if_inner_specification_returns_false() { when(this.mockInnerSpecification.isSatisfiedBy(this.request)).thenReturn(false); boolean isSatisfied = this.specification.isSatisfiedBy(this.request); assertTrue(isSatisfied); }