float previousQValue = 0.0F;
int n = 0, p = 0;
for (ListIterator<T> i = methods.listIterator(); i.hasNext();)
{
n = i.nextIndex();
ResourceMethodDescriptor rmd = i.next();
float qValue = MediaTypeHelper.processQuality(acceptable, rmd.produces());
if (qValue > previousQValue)
{
previousQValue = qValue;
p = n; // position of the best resource at the moment
}