### Question:
NameOrCrn { public static NameOrCrn ofCrn(String crn) { if (StringUtils.isEmpty(crn)) { throw new IllegalArgumentException(CRN_MUST_BE_PROVIDED_EXCEPTION_MESSAGE); } return new NameOrCrn(null, crn); } private  NameOrCrn(String name, String crn); static NameOrCrn ofName(String name); static NameOrCrn ofCrn(String crn); static NameOrCrn empty(); String getName(); String getCrn(); boolean hasName(); boolean hasCrn(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testOfCrn() { NameOrCrn nameOrCrn = NameOrCrn.ofCrn(CRN); assertEquals(CRN, nameOrCrn.crn); }
@Test public void testOfCrnWhenNull() { thrown.expectMessage("Crn must be provided."); thrown.expect(IllegalArgumentException.class); NameOrCrn.ofCrn(null); }
@Test public void testOfCrnWhenZeroLength() { thrown.expectMessage("Crn must be provided."); thrown.expect(IllegalArgumentException.class); NameOrCrn.ofCrn(""); }