Field f = PackageCriteria.class.getDeclaredField("filterName");
f.setAccessible(true);
String name = (String) f.get(crit);
if (CORRECT_PACKAGE_NAME.equals(name)) {
PackageAndLatestVersionComposite composite = new PackageAndLatestVersionComposite();
composite
.setGeneralPackage(new org.rhq.core.domain.content.Package(CORRECT_PACKAGE_NAME, null));
PackageVersion pv = new PackageVersion();
pv.setId(CORRECT_PACKAGE_VERSION_ID);
composite.setLatestPackageVersion(pv);
PageList<PackageAndLatestVersionComposite> ret = new PageList<PackageAndLatestVersionComposite>(
PageControl.getUnlimitedInstance());
ret.add(composite);
return ret;