protected function getEndpointsInClass(ReflectionClass $class, AnnotationSet $annotations)
    {
        $endpoints = new EndpointCollection();

        foreach ($annotations->method as $method => $methodAnnotations) {
            $this->addEndpoint($endpoints, $class, $method, $methodAnnotations);
        }

        foreach ($annotations->class as $annotation) {
            $annotation->modifyCollection($endpoints, $class);
        }

        return $endpoints;
    }