code: public int getLastElementCollectionObjectCount(Object rowKey)
      {
          if (getElementCollectionCache().get(rowKey) == null)
          {
              log.debug("No element collection object map found in cache for Row key " + rowKey);
              return -1;
          }
          else
          {
              Map<Object, String> elementCollectionMap = getElementCollectionCache().get(rowKey);
              Collection<String> elementCollectionObjectNames = elementCollectionMap.values();
              int max = 0;
  
              for (String s : elementCollectionObjectNames)
              {
                  String elementCollectionCountStr = s.substring(s.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) + 1);
                  int elementCollectionCount = 0;
                  try
                  {
                      elementCollectionCount = Integer.parseInt(elementCollectionCountStr);
                  }
                  catch (NumberFormatException e)
                  {
                      log.error("Invalid element collection Object name " + s);
                      throw new CacheException("Invalid element collection Object name " + s,e);
                  }
                  if (elementCollectionCount > max)
                  {
                      max = elementCollectionCount;
                  }
              }
              return max;
          }
      }
docs: Gets the last element collection object count.
  
  @param rowKey
  the row key
  @return the last element collection object count