AxiomDescriptor { public void setAssertionContext(Assertion assertion, URI context) { Objects.requireNonNull(assertion); if (!assertions.contains(assertion)) { throw new IllegalArgumentException("Assertion " + assertion + " is not present in this descriptor."); } assertionContexts.put(assertion, context); } AxiomDescriptor(NamedResource subject); void setSubjectContext(URI context); void addAssertion(Assertion assertion); void setAssertionContext(Assertion assertion, URI context); NamedResource getSubject(); URI getSubjectContext(); URI getAssertionContext(Assertion assertion); Set<Assertion> getAssertions(); boolean containsAssertion(Assertion assertion); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test void testSetAssertionContext() { sut.addAssertion(ASSERTION); assertNull(sut.getAssertionContext(ASSERTION)); sut.setAssertionContext(ASSERTION, CONTEXT); assertEquals(CONTEXT, sut.getAssertionContext(ASSERTION)); }
@Test void testSetAssertionContextInvalid() { assertThrows(IllegalArgumentException.class, () -> sut.setAssertionContext(ASSERTION, CONTEXT)); }