TokenGeneratorUuidImpl implements TokenGenerator { public String generateToken() { UUID uuid = UUID.randomUUID(); String uuidStr = uuid.toString(); uuidStr = uuidStr.replace("-", ""); uuidStr = uuidStr.replace("a", "10"); uuidStr = uuidStr.replace("b", "11"); uuidStr = uuidStr.replace("c", "12"); uuidStr = uuidStr.replace("d", "13"); uuidStr = uuidStr.replace("e", "14"); uuidStr = uuidStr.replace("f", "15"); return uuidStr; }  String generateToken();  }
@Test public void testGenerateToken() { TokenGeneratorUuidImpl sut = new TokenGeneratorUuidImpl(); String token = sut.generateToken(); Assert.assertTrue(token.matches("\\d+")); }