(a) A trust terminates when any of the following occurs:
- (1) The term of the trust expires.
- (2) The trust purpose is fulfilled.
- (3) The trust purpose becomes unlawful.
- (4) The trust purpose becomes impossible to fulfill.
- (5) The trust is revoked.
- (b) On termination of the trust, the trustee continues to have the powers reasonably necessary under the circumstances to wind up the affairs of the trust.