private static final String allocateKey(String base,Set<String> allocated){
  base=Strings.lower(base);
  int counter=0;
  String candidate=base;
  while (!allocated.add(candidate)) {
    candidate=base + "#" + counter;
    ++counter;
  }
  return candidate;
}

private static final String allocateKey ( String base , Set < String > allocated ) { base = Strings . lower ( base ) ; int counter = 0 ; String candidate = base ; while ( ! allocated . add ( candidate ) ) { candidate = base + "#" + counter ; ++ counter ; } return candidate ; }
adds a key that is not in allocated to it and returns the result . the result will have base as a prefix .
