private int searchForItem(String s, int startIndex, boolean wrap) {
        int size = getSize();
        int lastIndex = size - 1;
        if (startIndex > lastIndex) {
            if (wrap) {
                startIndex = 0;
            }
            else {
                startIndex = lastIndex;
            }
        }

        if (startIndex < 0) {
            startIndex = 0;
        }

        int index = -1;

        // Search from start index to end
        for (int j = startIndex; j < size; ++j) {
            if (performStringMatch(converter.convert(getElementAt(j)), s)) {
                index = j;

                break;
            }
        }

        // If no match and wrapping, search from 0 up to but not including
        // startIndex since startIndex already search in above for loop
        if ((index == -1) && wrap) {
            for (int j = 0; j < startIndex; ++j) {
                if (performStringMatch(converter.convert(getElementAt(j)), s)) {
                    index = j;

                    break;
                }
            }
        }

        return index;
    }