protected function filterContractAnnotation(array $annotations): array
    {
        $contractAnnotations = [];

        foreach ($annotations as $annotation) {
            $annotationClass = \get_class($annotation);

            if (\in_array($annotationClass, $this->expectedAnnotationTypes, true)) {
                $contractAnnotations[] = $annotation;
            }
        }

        return $contractAnnotations;
    }