private void addInternal(final T item, final int group, final int index) {
        this.list.add(index, item);

        modifyUpperIndex(group, 1);
        if (!this.groupToStart.containsKey(group)) {
            this.groupToStart.put(group, index);
            this.startToGroup.put(index, group);
        }
    }
returns the list index for the first object found in given group and fulfilling given test, or -1 if there's no such object
main/src/main/java/cgeo/geocaching/utils/GroupedList.java