private function overrideMethods(array $mockedMethods = null)
    {
        foreach ($this->extends as $className) {
            $reflectedClass = new ReflectionClass($className);

            foreach ($reflectedClass->getMethods() as $reflectedMethod) {
                /* @var $reflectedMethod \ReflectionMethod */
                if ($mockedMethods !== null && !in_array($reflectedMethod->getName(), $mockedMethods)) {
                    continue;
                }

                if ($reflectedMethod->isPrivate() || $reflectedMethod->isStatic() || $reflectedMethod->isConstructor()) {
                    continue;
                }

                $method = new MethodDefinition($reflectedMethod);

                $this->methods[$reflectedMethod->getName()] = $method;
                $this->mockedMethods[] = $reflectedMethod->getName();
            }
        }
    }