<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Currently the java.util.Objects provide the method `checkIndex(int, int)` for checking indexes.</div><div dir="ltr">It is convenient, but cannot be used to implement methods such as List::add(int, E) because these methods accept an index pointing to the end of the collection.</div><div dir="ltr">So is it possible to add a new method to Objects to check this kind of index?</div><div dir="ltr">This is useful for implementing collections.</div><div dir="ltr">(The checkPositionIndex in the title is its name in guava. I don't like the name, but I don't have a better idea.) </div><div dir="ltr"><br></div><div>Glavo</div></div></div></div></div></div></div>