docs: protected List<String> getTableNames(String sql) {
          Pattern[] patterns = {SELECT_TABLE_NAMES, NON_SELECT_TABLE_NAME};
          List<String> result = new ArrayList<String>();
          for (Pattern pattern : patterns) {
              Matcher matcher = pattern.matcher(sql);
              while (matcher.find()) {
                  for (int i=1; i <= MAX_NUM_TABLE_NAMES; i++) {
                      String group = null;
                      try {
                          group = matcher.group("table"+i);
                      } catch (IllegalArgumentException e) {
                          // The two patterns have different numbers of groups
                          // (table1, table2, etc.), so this may well happen
                          break;
                      }
                      if (group != null) {
                          result.add(group);
                      }
                  }
              }
          }
          return result;
      }