private boolean hasSubSet(Set<Entry<String, Object>> containerEntrySet, Map<String, Object> templateSubSet, boolean isToTakeTheLease, Map<String, Object> searchMap, ISemiSpaceTuple theTuple) {
        if (templateSubSet == null) {
            throw new SemiSpaceUsageException("Did not expect template sub set to be null");
        }
        //HUGE ISSUE: as this code is written, the templates include an ID value
        // which can NEVER be the same as a given tuple.
        templateSubSet.remove(ITupleFields.ID);
        //searchMap is from the tuple itself. In theory, if the tuple is read by an agent,
        //then that agent's name should be in it on the second pass.
//        log.logDebug("HASSUBSET-0 "+searchMap + " ||| "+templateSubSet);
        //NOTE: template has a String individual agentName whereas tuples
        // accumulate agentName in lists
        String agentName = (String)templateSubSet.get(ITupleFields.AGENT_NAME);
        Set<Entry<String, Object>> templateEntrySet = templateSubSet.entrySet();
//        log.logDebug("HASSUBSET-1 "+templateEntrySet+" "+agentName+" "+isToTakeTheLease);
    	boolean result = false;
        if (!isToTakeTheLease && agentName != null) {
        	//has this agent seen this tuple before?
        	Object o = searchMap.get(ITupleFields.AGENT_NAME);
 //       	log.logDebug("HASSUBSET-2 "+o);
        	if (o != null) {
        		if (o instanceof String)
        			result = ((String)o).equals(agentName);
        		else
        			result = ((List)o).contains(agentName);
        	}
        	
        }
//        log.logDebug("HASSUBSET-3 "+result);
        //note that "true" means this agent has seen this tuple before
        //so just leave with a "not found" result
        if (result)
        	return false;
        //The point here is that agentName is not a content field and, if present
        agentName = (String)templateSubSet.remove(ITupleFields.AGENT_NAME);
        //haven't seen it, is it the one?
        result = containerEntrySet.containsAll(templateEntrySet);
        //MUST PUT IT BACK IN THE TEMPLATE since the template is used in iterations
        if (agentName != null)
        	templateSubSet.put(ITupleFields.AGENT_NAME, agentName);
//        log.logDebug("HASSUBSET-4 "+result+" "+containerEntrySet+" "+templateEntrySet);
        if (result) {
        	//We found this tuple, so tell it that "agentName" was here!
        	//THIS IS COMPLEX!
        	// Just adding the agent name back here doesn't solve the problem
        	// since the next time the agent asks, the tuple will be fetched
        	// back from the queue (until it is times out or is taken) and the situation
        	// remains the same.
        	if (theTuple != null)
        		theTuple.addAgentName(agentName);
        }
        return result;
    }