code: @SuppressWarnings("unchecked")
      protected <T extends Serializable> CachedPortletResultHolder<T> getCachedPortletData(
              Serializable cacheKey, Ehcache outputCache, IPortletWindow portletWindow) {
  
          final Element publicCacheElement = outputCache.get(cacheKey);
          if (publicCacheElement == null) {
              logger.debug("No cached output for key {}", cacheKey);
              return null;
          }
  
          final CachedPortletResultHolder<T> cachedPortletData =
                  (CachedPortletResultHolder<T>) publicCacheElement.getObjectValue();
          if (publicCacheElement.isExpired() && cachedPortletData.getEtag() == null) {
              logger.debug("Cached output for key {} is expired", cacheKey);
              outputCache.remove(cacheKey);
              return null;
          }
  
          logger.debug("Returning cached output with key {} for {}", cacheKey, portletWindow);
          return (CachedPortletResultHolder<T>) publicCacheElement.getObjectValue();
      }
docs: Get the cached portlet data for the key, cache and window. If there is {@link
  CachedPortletData} in the cache it will only be returned if {@link
  CachedPortletData#isExpired()} is false or {@link CachedPortletData#getEtag()} is not null.
  
  @param cacheKey The cache key
  @param outputCache The cache
  @param portletWindow The portlet window the lookup is for
  @return The cache data for the portlet window