docs: private static long toArrayIndex(String id)
      {
          long index = toArrayIndex(ScriptRuntime.toNumber(id));
          // Assume that ScriptRuntime.toString(index) is the same
          // as java.lang.Long.toString(index) for long
          if (Long.toString(index).equals(id)) {
              return index;
          }
          return -1;
      }