@Test(expected = IllegalStateException.class) public void testOverSatisfaction() { final ResourceRequest rr = get(1); rr.satisfyOne(); rr.satisfyOne(); Assert.fail("Satisfying more than the request should throw an IllegalStateException"); }
void satisfyOne() { this.satisfied += 1; if (this.satisfied > req.getResourceCount()) { throw new IllegalStateException("This request has been oversatisfied."); } }
ResourceRequest { void satisfyOne() { this.satisfied += 1; if (this.satisfied > req.getResourceCount()) { throw new IllegalStateException("This request has been oversatisfied."); } } }
ResourceRequest { void satisfyOne() { this.satisfied += 1; if (this.satisfied > req.getResourceCount()) { throw new IllegalStateException("This request has been oversatisfied."); } } ResourceRequest(final ResourceRequestEvent req); }
ResourceRequest { void satisfyOne() { this.satisfied += 1; if (this.satisfied > req.getResourceCount()) { throw new IllegalStateException("This request has been oversatisfied."); } } ResourceRequest(final ResourceRequestEvent req);  }
ResourceRequest { void satisfyOne() { this.satisfied += 1; if (this.satisfied > req.getResourceCount()) { throw new IllegalStateException("This request has been oversatisfied."); } } ResourceRequest(final ResourceRequestEvent req);   }