Uuid { public String getUUID() { return toString(); }  String getUUID(); @Override String toString();  }
@Test public void generatesValidType4UUID() { Uuid uuid = new Uuid(); String generatedUUID = uuid.getUUID(); assertThat(generatedUUID).matches("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"); }
@Test public void uuidDoesNotChangeBetweenRuns() { Uuid uuid = new Uuid(); String firstUuid = uuid.getUUID(); String secondUuid = uuid.getUUID(); assertThat(firstUuid).isEqualTo(secondUuid); }