Expectations expectations = new Expectations();
expectations.atLeast(0).of(source).getPackages();
expectations.will(returnValue(Arrays.asList(package1, package2)));
expectations.atLeast(0).of(package1).getTargetFramework();
expectations.will(returnValue(EnumSet.allOf(Framework.class)));
expectations.atLeast(0).of(package2).getTargetFramework();
expectations.will(returnValue(EnumSet.of(Framework.net20)));
context.checking(expectations);
//WHEN
@SuppressWarnings("unchecked")
Collection<Nupkg> result = (Collection<Nupkg>) executor.execQuery(source, null, null, "NET11");