public int countInstances(MockTaskDef taskDef, long expectedState) throws DefinitionNotFoundException {
public int countInstances(MockProcessDef processDef) throws DefinitionNotFoundException {
    public int countInstances(MockTaskDef taskDef, long expectedState) throws DefinitionNotFoundException {    	int x = 0;    	for (Iterator it = audit.iterator();it.hasNext();) {    		Object o = it.next();    		if (o instanceof MockTaskInstance) {    			MockTaskInstance ti = (MockTaskInstance) o;    			if (ti.getTaskDefinition().equals(taskDef)) {    				if(ti.getState()==expectedState) {    					x++;    				}    			}    		}    	}		return x;    }