if (ParameterValidation.existsAndIsNotEmpty(importedPortlets))
{
for (ImportedPortlet importedPortlet : importedPortlets)
{
org.oasis.wsrp.v2.PortletContext portletContext = importedPortlet.getNewPortletContext();
PortletContext apiPC = PortletContext.createPortletContext(portletContext.getPortletHandle(), portletContext.getPortletState(), false);
// we need to reference the resulting PortletContext so that it can then be used properly
importIdToPortletContext.put(importedPortlet.getImportID(), PortletContext.reference(getProducerId(), apiPC));
}
}