/**
   * Gets the <tt>ContactDetail</tt>s of this <tt>SourceContact</tt> which support a specific
   * <tt>OperationSet</tt>.
   *
   * @param operationSet the <tt>OperationSet</tt> the supporting <tt>ContactDetail</tt>s of which
   *     are to be returned
   * @return the <tt>ContactDetail</tt>s of this <tt>SourceContact</tt> which support the specified
   *     <tt>operationSet</tt>
   * @see SourceContact#getContactDetails(Class)
   */
  public List<ContactDetail> getContactDetails(Class<? extends OperationSet> operationSet) {
    List<ContactDetail> contactDetails = new LinkedList<ContactDetail>();

    for (ContactDetail contactDetail : getContactDetails()) {
      List<Class<? extends OperationSet>> supportedOperationSets =
          contactDetail.getSupportedOperationSets();

      if ((supportedOperationSets != null) && supportedOperationSets.contains(operationSet))
        contactDetails.add(contactDetail);
    }
    return contactDetails;
  }
  /**
   * Returns a list of all <tt>ContactDetail</tt>s corresponding to the given category.
   *
   * @param category the <tt>OperationSet</tt> class we're looking for
   * @return a list of all <tt>ContactDetail</tt>s corresponding to the given category
   */
  public List<ContactDetail> getContactDetails(ContactDetail.Category category) {
    List<ContactDetail> contactDetails = new LinkedList<ContactDetail>();

    for (ContactDetail contactDetail : getContactDetails()) {
      if (contactDetail != null) {
        ContactDetail.Category detailCategory = contactDetail.getCategory();
        if (detailCategory != null && detailCategory.equals(category))
          contactDetails.add(contactDetail);
      }
    }
    return contactDetails;
  }