code: public T newInstance(Map<String, Object> fields)
  	{
  		try
  		{
  			FactoryDefinition<T> bestDef = factories[0];
  			int bestScore = bestDef.getScore(fields);
  
  			for(int i=1, n=factories.length; i<n; i++)
  			{
  				int score = factories[i].getScore(fields);
  				if(score > bestScore)
  				{
  					bestDef = factories[i];
  					bestScore = score;
  				}
  			}
  
  			return bestDef.create(fields);
  		}
  		catch(RuntimeException e)
  		{
  			throw new RuntimeException("Could not create " + type + "; " + e.getMessage(), e);
  		}
  	}
docs: Create a new instance.
  
  @param fields
  @return