XGH { public Axiom axiom(int number) { if (number < 1 || number > axioms.size()) { throw new IllegalArgumentException(String.format("Axiom %d is not defined", number)); } return axioms.get(number - 1); } XGH(String lang);  XGH(); Axiom axiom(int number); Axiom randomAxiom();  }
@Test public void testAxioms() { Spec.given(new XGH()) .expect(doing(xgh -> xgh.axiom(1)), to().succeed()) .expect(doing(xgh -> xgh.axiom(23)), to().fail()) .expect(doing(xgh -> xgh.axiom(0)), to().fail()); for (int i = 1 ; i <= 22 ; i++) { Spec.given(new XGH()) .expect(axiom(i), to().have(number(i))); } }