In Wilde's The Importance of Being Earnest, both the main character of Jack/Ernest and his best buddy Algernon, discover in the first act that they lead double lives. Jack himself has one identity for his home in the country, where he must be a responsible landowner with a young ward, and one for the city, where he goes to escape those responsibilities. His motives are different from those of Algernon, who does not have an alter ego, but an imaginary friend, one Bunbury, whom he uses as an excuse to get away from social engagements where he does not want to be.
One does not have to think too hard to see that both of these scams could fail miserably in the small social world of upper-class London, but Jack and Algernon seem oblvious. Of course, the entire play is about just that - what happens when the worlds of Jack/Ernest/Algernon/Bunbury collide, and the complications to both Jack's and Algernon's lives that culminate in the discovery that Jack really was Ernest after all.