### Question:
ServerId implements Serializable { public static ServerId of(String value) { Iterable<String> parts = Splitter.on(SERVER_ID_SEPARATOR).split(value); if (Iterables.size(parts) > 2) { throw new InvalidServerId("Too many parts for a serverId"); } Iterator<String> iterator = parts.iterator(); return of(getCollectionId(iterator, value), getItemId(iterator)); } private  ServerId(CollectionId collectionId, Integer itemId); static ServerId of(String value); static ServerId of(CollectionId collectionId, Integer ItemId); CollectionId getCollectionId(); Integer getItemId(); boolean isItem(); boolean belongsTo(CollectionId collectionId); @Override final int hashCode(); @Override final boolean equals(Object object); String asString(); @Override String toString();  }### Answer:
@Test(expected=InvalidServerId.class) public void emptyStringShouldThrowAtCreation() throws InvalidServerId { ServerId.of(""); }
@Test(expected=NullPointerException.class) public void nullStringShouldThrowAtCreation() throws InvalidServerId { ServerId.of(null); }
@Test(expected=InvalidServerId.class) public void nonIntegerValueShouldThrowAtCreation() throws InvalidServerId { ServerId.of("azd"); }
@Test(expected=InvalidServerId.class) public void nonIntegerCollectionIdShouldThrowAtCreation() throws InvalidServerId { ServerId.of("azd:123"); }
@Test(expected=InvalidServerId.class) public void tooLargeCollectionIdShouldThrowAtCreation() throws InvalidServerId { ServerId.of("123456789123456"); }
@Test(expected=InvalidServerId.class) public void nonIntegerItemIdShouldThrowAtCreation() throws InvalidServerId { ServerId.of("123:abc"); }
@Test(expected=InvalidServerId.class) public void tooLargeItemIdShouldThrowAtCreation() throws InvalidServerId { ServerId.of("123:123456789123456"); }
@Test(expected=InvalidServerId.class) public void tooManyPartsStringShouldThrowAtCreation() throws InvalidServerId { ServerId.of("123:123:123"); }
@Test(expected=InvalidServerId.class) public void weirdStringValueShouldThrowAtCreation() throws InvalidServerId { ServerId.of(":123:123"); }
@Test(expected=InvalidServerId.class) public void nullCollectionIdShouldThrow() { ServerId.of(null, 12); }