The "marshmallow test" that Violet shows to the professor and her fellow students during a meeting was not invented for a movie. It's a real long-standing psychological study used to see how little kids would handle issues such as temptation, self-control, and honesty. However, there is no evidence that a version that Violet suggests (one aimed entirely at adults with some element changes) has ever been carried out in real life.
David Paymer signed onto the film as he wanted to work with Jason Segel and Judd Apatow. But he really wanted to work on it as he could return to Ann Arbor, Michigan where he's an alumni of the University of Michigan-Ann Arbor.
The trivia item below may give away important plot points.
In early trailers for the movie, just before Emily Blunt is shot in the leg with a crossbow, you hear the little girl say "I'm Pocahontas." In later trailers, to play off the anticipation and success of The Hunger Games (2012), it was changed to "I'm Katniss." The Pocahontas (1995) reference was kept in the finished film.