Apparently, Justice Roberts was the primary drafter of both the dissenting and majority opinions in the Affordable Care Act case (see here).
Like most law professors, I always try to teach my students that they need to be able to argue, or at least understand, both sides of a case; but this is stretching a point. If true, it is (so far as I am aware) unprecedented in the history of the Republic. It is tempting to conclude that Justice Roberts dissented from himself, but that claim cannot be maintained because the two opinions presumably would have been written at different times, the dissent before and the majority opinion after Roberts switched sides.
I should also say that it's nice to learn that a Justice of the US Supreme Court can, like an ordinary academic, have the experience of talking himself out of an argument by the very act of spelling it out on paper (or in pixels, as it were).