Appeared in the 1994 film Forrest Gump, when the lead character Forrest Gump (played by Tom Hanks) says "Mama always said life was like a box of chocolates. You never know what you're gonna get."
The book Norwegian Wood by Haruki Murakami, first published in Japanese in 1987, and in English in 1989, has the following: "Just remember, life is like a box of chocolates." ... "You know, they've got these chocolate assortments, and you like some but you don't like others? And you eat all the ones you don't like as much? I always think about that when something painful comes up. 'Now just polish these off, and everything'll be OK.' Life is a box of chocolates."