@Override
    public boolean contains(Priority<X> x)
    {   boolean found = false;
    	if( x == null){
        	throw new NullPointerException();
        }
    	synchronized(lock){
    		for(int i=1; i<=nrOfNodes;i++){
    			Priority<X> p = tasks[i];
    			if(p.equals(x)){
    				found = true;
    				break;
    			}
    		}
    	}
        return found;
    }