static String createUniqueSymbol(CNode node, String basis) {
        Set<String> usedSymbols = Arrays.stream(node.getChildren()).map(CNode::getName).collect(Collectors.toSet());
        Random rng = new Random();

        for (int i = 1;; i++) {
            String candidate = (i < basis.length()) ? basis.substring(0, i)
                    : ReservedWords.INTERNAL_PREFIX + basis + rng.nextInt(Integer.MAX_VALUE);
            if ( ! usedSymbols.contains(candidate)) {
                return candidate;
            }
        }
    }
Returns a name that can be safely used as a local variable in the generated
config class for the given node. The name will be based on the given basis
string, but the basis itself is not a possible return value.

@param node the node to find a unused symbol name for.
@param basis the basis for the generated symbol name.
@return a name that is not used in the given config node.
configgen/src/main/java/com/yahoo/config/codegen/JavaClassBuilder.java