### Question:
BookieId { public static BookieId parse(String serialized) { return new BookieId(serialized); } private  BookieId(String id); @Override String toString(); static BookieId parse(String serialized); String getId(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testParse() { assertEquals("test", BookieId.parse("test").getId()); }
@Test(expected = IllegalArgumentException.class) public void testValidate1() { BookieId.parse("non valid"); }
@Test(expected = IllegalArgumentException.class) public void testValidate2() { BookieId.parse("non$valid"); }
@Test(expected = IllegalArgumentException.class) public void testValidateReservedWord() { BookieId.parse("readonly"); }
@Test public void testValidateHostnamePort() { BookieId.parse("this.is.an.hostname:1234"); }
@Test public void testValidateIPv4Port() { BookieId.parse("1.2.3.4:1234"); }
@Test public void testWithDashAndUnderscore() { BookieId.parse("testRegisterUnregister_ReadonlyBookie-readonly:3181"); }