code: public static void checkForDuplicateNames(
              Map<String, Boolean> isDuplicateName, Cursor cursor, int nameIndex) {
          isDuplicateName.clear();
          cursor.moveToPosition(-1);
          while (cursor.moveToNext()) {
              String displayName = cursor.getString(nameIndex);
              // Set it to true if we've seen this name before, false otherwise
              if (displayName != null) {
                  isDuplicateName.put(displayName, isDuplicateName.containsKey(displayName));
              }
          }
      }
docs: Scan through a cursor of calendars and check if names are duplicated.
  This travels a cursor containing calendar display names and fills in the
  provided map with whether or not each name is repeated.
  
  @param isDuplicateName The map to put the duplicate check results in.
  @param cursor          The query of calendars to check
  @param nameIndex       The column of the query that contains the display name