@SuppressWarnings("unchecked")
PackageSource<? extends Nupkg> packageSource = context.mock(PackageSource.class);
Expectations expectations = new Expectations();
expectations.atLeast(0).of(packageSource).getPackages();
expectations.will(returnValue(Arrays.asList(firstPackage, secondPackage)));
expectations.atLeast(0).of(firstPackage).getId();
expectations.will(returnValue("first.package"));
expectations.atLeast(0).of(firstPackage).getNuspecFile();
expectations.will(returnValue(firstNuspec));
expectations.atLeast(0).of(secondPackage).getId();
expectations.will(returnValue("second.package"));