Mock mockf1 = new Mock(Fragment.class);
mockf1.expects(new InvokeAtLeastOnceMatcher()).method("getName").will(new ReturnStub(pd.getUniqueName()));
mockf1.expects(new InvokeAtLeastOnceMatcher()).method("getId").will(new ReturnStub(TEST_ENTITY));
ContentFragment f1 = new ContentFragmentTestImpl((Fragment) mockf1.proxy(), new HashMap());
PortletEntity entity = entityAccess
.generateEntityFromFragment(new ContentFragmentTestImpl(f1, new HashMap()));
// TODO: how to access prefs of entity??
/*
PreferenceSetComposite prefs = (PreferenceSetComposite) entity.getPreferenceSet();
prefs.remove("pref1");