means a written agreement or a testamentary writing or a court order according to which a trust was created;