from abc import abstractmethod, ABC
from typing import Generic, TypeVar

AnyType = TypeVar("AnyType")


class DependencyBuilder(Generic[AnyType], ABC):

    @abstractmethod
    def build(self) -> AnyType:
        raise NotImplementedError()

    @abstractmethod
    def destroy(self, instance: AnyType) -> None:
        raise NotImplementedError()
