code: private void buildSections() {
          if (hasOpenCursor()) {
              Cursor cursor = getCursor();
              cursor.moveToPosition(-1);
              mSections = buildSections(cursor);
              if (mSections == null) {
                  mSections = new TreeMap<Integer, Object>();
              }
          }
      }
docs: If the adapter's cursor is not null then this method will call buildSections(Cursor cursor).