private static function getSpyClassCodeLinesWithOverriddenMethodsForClassOrInterface(array $spyClassCode, $classOrInterface)
    {
        $reflection = new ReflectionClass($classOrInterface);
        $baseClassPublicMethods = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
        $baseClassMethodsThatMustBeOverridden = array_map('self::getReflectedMethodAsSpyClassCode', $baseClassPublicMethods);

        // insert and override methods from base class at end of spy class definition
        array_splice($spyClassCode, (count($spyClassCode)-1), 0, $baseClassMethodsThatMustBeOverridden);

        return $spyClassCode;
    }