This weekend, when moviegoers watch slatternly educator Cameron Diaz try to seduce wealthy, nerdy substitute Justin Timberlake in the comedy 'Bad Teacher,' a lot of those viewers will be looking for a little extra spark of tension. After all, you don't have to follow celebrity gossip all that closely to know that, in real life, Diaz and Timberlake dated for nearly four years before breaking up in 2007. Why would they want to work together again? And how will their failed romance off-screen affect their chemistry on-screen?

It turns out that real-life exes reuniting in movies isn't all that rare. Whatever bitterness and hurt feelings may have attended the break-up, Hollywood stars tend to be pros who can set aside their stormy shared pasts and work together again amicably. In fact, sometimes viewers may wish there was more drama evident on-screen between some exes.

In the case of 'Bad Teacher,' director Jake Kasdan spoke to Entertainment Weekly's PopWatch blog during last year's shoot and said Diaz was enthusiastic about Timberlake's casting. "They're good friends, and they're both incredibly funny people," Kasdan said. "They have a shared sense of humor. It's easy for them to be funny together."

Below, we've compiled a list of some famous former couples who worked together again after their break-ups. Some of the results were classic films, some not-so-classic. If you see 'Bad Teacher' this weekend, come back and let us know which camp you think the Diaz-Timberlake reunion belongs in.

Warren Beatty, Goldie Hawn and Julie Christie: Beatty deserves special mention for starring opposite both ex Goldie Hawn and then-current girlfriend Julie Christie in 1975's 'Shampoo.' In the film, a sexual satire on the bed-hopping ethics of Hollywood in the late 1960s and early 1970s (behavior for which there was no better emblem than Beatty himself), Beatty plays a womanizing Beverly Hills hairdresser who becomes disenchanted with his current girlfriend (Hawn) and returns to his old flame (Christie), who's the mistress of a rich man (Jack Warden). The film climaxes when Hawn and Warden walk in on Beatty and Christie having vigorous sex. ("Now, that's what I call f--king," exclaims Warden, before he realizes who the couple is.)

Beatty had dated Christie off and on for eight years; during their courtship, they had also made the 1971 Robert Altman classic 'McCabe and Mrs. Miller.' They broke up for good after 'Shampoo,' but when Beatty made his directorial debut in 1978 with 'Heaven Can Wait,' he again cast Christie as his love interest. He plays a quarterback reincarnated as a wealthy industrialist; she's an environmental activist who assumes he's a hateful, rapacious tycoon. Their romance in the film is surprisingly sweet and old-fashioned, as Beatty spends the movie pursuing Christie like a puppy and trying to impress her, while she slowly melts to his charm. Like 'Shampoo,' 'Heaven' turned out to be an enormous hit that pleased both critics and audiences.

Woody Allen and Diane Keaton: Allen and Keaton famously dated for years in the early 1970s, and while they were largely over as a couple by 1972, she was his romantic leading lady throughout the '70s. Each seemed attuned to the other's neurotic rhythms in such beloved comedies as 'Play it Again, Sam,' 'Sleeper,' 'Love and Death,' 'Manhattan,' and especially 'Annie Hall,' which was a practically autobiographical account of their on-again-off-again relationship. (Hall is Keaton's given last name.) That movie won Oscars for Best Picture, Best Director (for Allen), Best Screenplay (which Allen shared with Marshall Brickman) and Best Actress for Keaton, and today it's recognized as one of the best romantic comedies of all time.

During the 1980s, Allen's leading lady on- and off-screen was Mia Farrow. After their notoriously ugly 1992 split, Allen needed a new co-star for 'Manhattan Murder Mystery,' so he returned to Keaton. Working together for the first time in 14 years, they easily fell into the rhythm of the film's bickering, long-married couple, whose passions are reignited when they find themselves sleuthing a neighbor's mysterious death. They have not worked together since that 1993 film, but Allen and Keaton speak warmly about each other to this day.

Diane Keaton and Al Pacino: Keaton dated Pacino off and on during the production of the first two 'Godfathers' in the early 1970s, when they played unhappy couple Kay and Michael Corleone. Sixteen years later, they reunited for 1990's 'The Godfather Part III.' In this sequel, Michael and Kay are long divorced and still chilly to each other; in real life, Pacino and Keaton briefly rekindled their romance during the shoot. It's a testament to their skill as actors that none of their renewed fire is apparent in the frosty relations between Michael and Kay.

A final note about Keaton, to bring us full circle: In the late 1970s, she dated Beatty, who cast her as his love interest in 'Reds.' By the time the 1981 film went into production, the two had broken up, but the scenes between the two lovers, set against the backdrop of the Russian Revolution, were passionate and intense.

Jack Nicholson and Anjelica Huston: Nicholson and Huston dated for nearly 20 years, during which time they appeared together in 1985's mob satire 'Prizzi's Honor,' playing exes with a complicated past. Huston won an Oscar for the movie, which was directed by her father, John Huston. The two actors had a bitter break-up in 1990, but actor-turned-director Sean Penn persuaded them to reunite for his bleak 1995 drama 'The Crossing Guard.' It certainly wasn't a stretch to see them playing antagonistic exes, who've divorced in the wake of their daughter's death at the hands of a drunk driver. Penn pushes his stars into some very dark emotional corners, and their effectiveness speaks to their trust not only in each other, but in their young, relatively unseasoned director as well.

Julia Roberts and Liam Neeson: Before they were stars, Roberts and Neeson had a fling on the set of 1988's 'Satisfaction,' in which she played the sluttiest member of an all-girl rock band and he played the group's manager. Eight years later, when they were both A-listers, director Neil Jordan reunited them in 'Michael Collins,' starring Neeson as the Irish revolutionary and Roberts as his fiancée, Kitty Kiernan. In interviews before the film's release, both Neeason and Roberts dismissed their past romance as no big deal and water under the bridge. (By that time, he was married to Natasha Richardson, while she had married and divorced Lyle Lovett.) Still, their on-screen romance in 'Michael Collins' seemed muted, perhaps because of their limited screen time together, or perhaps because Roberts seemed to be concentrating more on mastering an Irish accent than on being wooed by Neeson's character. Whatever the two actors had shared years before, there was little evidence of it in the 1996 film.

Gwyneth Paltrow and Ben Affleck: Paltrow and Affleck had famously dated in the late 1990s, including while he co-starred in a small role opposite her in 1998's 'Shakespeare in Love.' After a low-key break-up, the two reunited in 2000 for the romantic drama 'Bounce.' In interviews promoting the film, they were coy about whether they'd rekindled their romance off-screen. In the film, their relationship seems tentative, though that fits the screenplay. (The story has Affleck tracking down Paltrow out of guilt over having given his airplane ticket to her husband, who died when the flight crashed; Paltrow warms to Affleck without knowing that he's the one who gave her husband the fatal ticket.) Like their off-screen romance, Paltrow and Affleck's on-screen romance in 'Bounce' wasn't one for the ages, and both stars quickly moved on to greener pastures, professionally and personally.

Luke Wilson and Drew Barrymore: Wilson and Barrymore were already a couple when they co-starred in the offbeat 1998 romance 'Home Fries.' They were over by the time Barrymore co-produced and starred in 2000's 'Charlie's Angels,' and during the shoot, she fell for future husband Tom Green, who played her boyfriend in the film. Nonetheless, she found a part for Wilson, as a love interest for Cameron Diaz. "That's Drew -- she didn't let the personal stuff get in the way," Wilson told People Magazine at the time.


Drew Barrymore and Justin Long: Barrymore and Long began their romance when they co-starred in the 2009 ensemble romantic comedy 'He's Just Not That Into You.' They split in mid-2008, but a year later, they were back together both in front of and behind the camera as they played a couple trying to keep a long-distance relationship alive in 'Going the Distance.' Released in late 2010, the film fizzled, and so did Barrymore and Long, this time for good.

•Follow Gary Susman on Twitter @garysusman.