private int getLastNonNumberIndex(String name, int lastNumberIndex) {
    int index = lastNumberIndex - 1;
    while (index >= 0 && Character.isDigit(name.charAt(index))) {
      index--;
    }
    if (index < -1)
      return -1;
    return index;
  }