public function valid()
    {
        if (!isset($this->keys[$this->index])) {
            return false;
        }

        $hasContent = $this->hasContentForKey($this->keys[$this->index], $this->content);

        if (!$hasContent && $this->throwOnNotReachable) {
            $message = sprintf('No current content contains new content at a key of "%s".', $this->keys[$this->index]);
            throw new PathNotReachableException($this->keys[$this->index], $message);
        }

        return $hasContent;
    }