public function when(callable $predicate): self
    {
        $layer = new self();
        $layer->parent = $this;
        $layer->predicates[] = $predicate;

        $this->layers[] = $layer;

        return $layer;
    }