Code example for Cache

Methods: getIfPresentput

0
     *  
     * @return null of the user who has already created an entry  
     */ 
    public CmsUser update(CmsObject cms, String siteRoot) {
 
        CmsUser originalUser = m_map.getIfPresent(siteRoot);
        if ((originalUser == null) || originalUser.equals(cms.getRequestContext().getCurrentUser())) {
            m_map.put(siteRoot, cms.getRequestContext().getCurrentUser());
            return null; 
        } 
        return originalUser;
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java