private static RegExpAtom getSingleAtom(RegExpPattern pattern) {
    if (pattern == null) return null;
    final RegExpBranch[] branches = pattern.getBranches();
    if (branches.length != 1) return null;
    final RegExpAtom[] atoms = branches[0].getAtoms();
    return atoms.length != 1 ? null : atoms[0];
  }
private static RegExpAtom getSingleAtom(RegExpPattern pattern)