Bundle installedBundle1 = EasyMock.createMock(Bundle.class);
Bundle installedBundle2 = EasyMock.createMock(Bundle.class);
// required since the sorted set uses it
expect(installedBundle1.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();
expect(installedBundle2.compareTo(EasyMock.<Bundle>anyObject())).andReturn(0).anyTimes();
// Installs feature f1 and f2
expect(bundleContext.getBundles()).andReturn(new Bundle[0]).anyTimes();
expect(bundleContext.installBundle(eq(bundle1), isA(InputStream.class))).andReturn(installedBundle1);
expect(installedBundle1.getBundleId()).andReturn(12345L);