When they started, Google expected that they were within bounds with Sun.
Then, Oracle bought Sun. And waited until they felt sure that they could have Google in a corner. And originally they were suing each other for billions, but that was tossed.
Two sides to every case, the next round will prove interesting.