public static function getNotDeleted($objects)
    {
        if (null === $objects) {
            return null;
        }

        if (!$objects instanceof Collection) {
            $objects = new ArrayCollection($objects);
        }

        foreach ($objects as $object) {
            $functionDeletedOld = [
                $object,
                "getDeleted"
            ];

            $functionDeletedNew = [
                $object,
                "isDeleted"
            ];

            if (true === is_callable($functionDeletedOld) && true === $object->getDeleted()) {
                $objects->removeElement($object);
            } elseif (true === is_callable($functionDeletedNew) && true === $object->isDeleted()) {
                $objects->removeElement($object);
            }
        }

        return $objects;
    }