UUIDUtility { public static Optional<UUID> parseFromString(String uuidString) { try { return Optional.of(UUID.fromString(uuidString)); } catch (IllegalArgumentException malformedUUIDException) { return Optional.empty(); } } @Inject  UUIDUtility(DBSystem dbSystem, ErrorLogger errorLogger); static Optional<UUID> parseFromString(String uuidString); UUID getUUIDOf(String playerName);  }
@Test void stringUUIDIsParsed() { String test = "f3cc3e96-1bc9-35ad-994f-d894e9764b93"; assertEquals(UUID.fromString(test), UUIDUtility.parseFromString(test).orElse(null)); }