UuidUtils { public static boolean validateUUID(String uuid) { RegularExpression regex = new RegularExpression("[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}"); return regex.matches(uuid); }  final static String first(String uuid); static boolean validateUUID(String uuid);  }
@Test public void testValidateUUIDPass() throws Exception { String serviceUuid = "f81a9aa3-1f7d-466f-b04b-f2b101486bae"; assertTrue(UuidUtils.validateUUID(serviceUuid)); }
@Test public void testValidateUUIDFail() throws Exception { String serviceUuid = "6fc6ce7-d503-4f95-9e68-c9cd281b13df"; assertFalse(UuidUtils.validateUUID(serviceUuid)); }