Id { @JsonCreator public static <T> Id<T> valueOf(String id) { return new Id<>(id); } private  Id(String id); @JsonCreator static Id<T> valueOf(String id); static Id<T> random(); @JsonValue String get(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); byte[] getBytes();  }
@Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "id is null") public void testNullId() { Id.valueOf(null); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "id is empty") public void testEmptyId() { Id.valueOf(""); }