While they really have to be substantially similar to allow interoperability, OpenJDK is open source (GPL) and Oracle's Java is not.
That brings up a couple questions which don't directly bear on the case just heard by the Supremes, but are (IMHO) relevant to potential second-order consequences of a ruling for Oracle:
1. Given that the OpenJDK API is substantially similar to the Oracle Java API, could Google avoid repercussions by switching to the former from their "adaptation" of the latter?
2. Should an API be considered eligible for copyright, wouldn't that enable opportunities for language and library developers to restrict others from developing competing (via performance or utility enhancements) languages/libraries by forcing anyone who wished to implement enhancements to either purchase a license or flat out deny them the ability to do so (assuming the product --including the API isn't open source)?
3. If (2) is the case, what does that mean for incremental improvements of languages and libraries?
I'm not a java dev or a copyright expert, so pardon me if I missed an important point.