code: public ManagedConnection matchManagedConnections(Set connectionSet,
                                                      Subject subject, ConnectionRequestInfo cxRequestInfo) 
        throws ResourceException
     {
        ManagedConnection result = null;
  
        Iterator it = connectionSet.iterator();
        while (result == null && it.hasNext()) 
        {
           ManagedConnection mc = (ManagedConnection)it.next();
           if (mc instanceof HelloWorldManagedConnection) 
           {
              HelloWorldManagedConnection hwmc = (HelloWorldManagedConnection)mc;
              result = hwmc;
           }
        }
  
        return result;
     }
docs: Returns a matched connection from the candidate set of connections.
  
  @param connectionSet Candidate connection set
  @param subject Caller's security information
  @param cxRequestInfo Additional resource adapter specific connection request information
  @throws ResourceException generic exception
  @return ManagedConnection if resource adapter finds an acceptable match otherwise null