code: private void checkColorIndex(int index) {
      if (index < 0 || index >= mColors.length) {
        throw new IllegalArgumentException(String.format(Locale.US, "Index %d not valid", index));
      }
    }
docs: /////////////////     Checks