public function matches(Statement $toTest)
    {
        if ($this->isConcrete() && $this->equals($toTest)) {
            return true;
        }

        if ($toTest instanceof Statement &&
            $this->getSubject()->matches($toTest->getSubject()) &&
            $this->getPredicate()->matches($toTest->getPredicate()) &&
            $this->getObject()->matches($toTest->getObject())
        ) {
            if ($this->isQuad() && $toTest->isQuad() && $this->getGraph()->matches($toTest->getGraph())) {
                return true;
            } elseif ($this->isQuad() && $this->getGraph()->isPattern()) {
                /*
                 * This case also matches the default graph i.e. if the graph is set to a variable it also matches the
                 * defaultgraph
                 */
                return true;
            } elseif ($this->isTriple() && $toTest->isTriple()) {
                return true;
            }
            /*
             * TODO What should happen if $this->isTriple() is true, should this pattern match any $quad?
             * This is the same descission, as, if the default graph should contain the union of all graphs!
             *
             * As I understand the situation with SPARQL it doesn't give a descission for this, but in the case that
             * named graphs are included in a query only using FROM NAMED the default graph is empty per definiton.
             * {@url http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#rdfDataset}
             */
        }

        return false;
    }