// walk through the set starting with the most recent version, looking
// for a match until we exhaust all known versions
Iterator it = set.iterator();
while (it.hasNext())
{
AbstractPolicy policy = (AbstractPolicy) (it.next());
if (constraints.meetsConstraint(policy.getVersion()))
{
// we found a valid version, so see if it's the right kind,
// and if it is then we return it
if (type == PolicyReference.POLICY_REFERENCE)
{