code: public <T> T getOneOptional(Class<T> type, Object locator) {
  		try {
  			List<T> components = find(type, locator, false);
  			return components.size() > 0 ? components.get(0) : null;
  		} catch (Exception ex) {
  			return null;
  		}
  	}
docs: Gets an optional component reference that matches specified locator and
  matching to the specified type.
  
  @param type    the Class type that defined the type of the result.
  @param locator the locator to find references by.
  @return a matching component reference or null if nothing was found.