code: public int getIndexForPosition(int position) {
          int nSections = 0;
  
          Set<Entry<String, Integer>> entrySet = mSections.entrySet();
          for(Entry<String, Integer> entry : entrySet) {
              if(entry.getValue() < position) {
                  nSections++;
              }
          }
  
          return position - nSections;
      }
docs: Returns the actual index of the object in the data source linked to the this list item.
  
  @param position List item position in the {@link ListView}.
  @return Index of the item in the wrapped list adapter's data source.