### Question:
License implements Serializable { public void reject() { accepted = false; throw new LicenseRejectedException(this); } License(final String filename, final String text);  License(License toCopy); boolean isAccepted(); void accept(); void reject(); String getFilename(); String getLicenseText(); Iterable<String> lines(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test(expectedExceptions = LicenseRejectedException.class) public void shouldThrowExceptionOnRejection() { License license = new License("...", "..."); license.reject(); }
@Test(expectedExceptions = LicenseRejectedException.class) public void shouldIncludeRejectedLicenseInException() throws Exception { License license = new License("...", "..."); try { license.reject(); } catch (LicenseRejectedException ex) { assertEquals(ex.getRejectedLicense(), license); throw ex; } }