My first thought is Ship in a Bottle, the episode that ends with
TROI: In a sense, you did give Moriarty what he wanted.
PICARD: In a sense. But who knows? Our reality may be very much like theirs. All this might be just be an elaborate simulation running inside a little device sitting on someone's table. Well, we have a newborn star to study. Mister Barclay, you will keep that safe?
BARCLAY: Aye, sir.
(everyone else leaves)
BARCLAY: Computer, end programme.
But perhaps I'll think of a better ep later on.