package utils; import java.util.UUID; /** Class to support the game rule * of generating unique names */ public class NameGenerator{ /** Generate a new name and return the string * @return string */ public static String getNewName(String name){ String uuidString = UUID.randomUUID().toString(); // Hyphens is not legal so it is replaced with underscore. return name+"_"+uuidString.replace('-', '_'); } }