### Question:
NameOrCrn { public static NameOrCrn ofName(String name) { if (StringUtils.isEmpty(name)) { throw new IllegalArgumentException(NAME_MUST_BE_PROVIDED_EXCEPTION_MESSAGE); } return new NameOrCrn(name, null); } 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 testOfName() { NameOrCrn nameOrCrn = NameOrCrn.ofName(NAME); assertEquals(NAME, nameOrCrn.name); }
@Test public void testOfNameWhenNull() { thrown.expectMessage("Name must be provided."); thrown.expect(IllegalArgumentException.class); NameOrCrn.ofName(null); }
@Test public void testOfNameWhenZeroLength() { thrown.expectMessage("Name must be provided."); thrown.expect(IllegalArgumentException.class); NameOrCrn.ofName(""); }