### Question:
GlobalId { public GlobalId(String globalId) throws IllegalArgumentException { try { String[] gid = globalId.split(":"); if(gid.length != 2) { throw new IllegalArgumentException("The provided GlobalId is not valid"); } this.domainName = new DomainName(gid[0]); this.localId = new LocalId(gid[1]); } catch(IllegalArgumentException e) { throw new IllegalArgumentException("The provided GlobalId is not valid"); } } GlobalId(String globalId);  GlobalId(DomainName domainName, LocalId localId);  GlobalId(String domainName, String localId); DomainName getDomainName(); void setDomainName(DomainName domainName); void setDomainName(String domainName); LocalId getLocalId(); void setLocalId(LocalId localId); void setLocalId(String localId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testGlobalId() throws Exception { DomainName dn = new DomainName("example.com"); LocalId lid = new LocalId("195mg90a39v"); GlobalId g1 = new GlobalId(dn, lid); assertTrue(g1 instanceof GlobalId); GlobalId g2 = new GlobalId("example.com:195mg90a39v"); assertTrue(g2 instanceof GlobalId); GlobalId g3 = new GlobalId("example.com", "195mg90a39v"); assertTrue(g3 instanceof GlobalId); }