*/
public class GetStarterCharVisitor extends DefaultMatcherVisitor<Character> {
@Override
public Character visit(AnyOfMatcher matcher) {
Characters characters = matcher.characters;
if (!characters.isSubtractive()) {
return characters.getChars()[0];
}
// for substractive sets we try to randomly choose a fitting character
Random random = new Random();
char c;
do {
c = (char) random.nextInt(Character.MAX_VALUE);
} while (!Character.isDefined(c) || !characters.contains(c));
return c;
}