Except that only the names have been copied. Google provided their own story. (Which is proven by the fact that Oracle didn't allege copyright infringement on any of the actual code except one trivial function, which was dismissed as de-minimus, especially since it had already been replaced.)
The thing you seem to be overlooking is that functionality is something that is specifically excluded from copyright protection. (Which is why trying to make book analogies for software is usually a complete waste of time and highly misleading. Functionality is almost never found in works of fiction; in books, it appears mainly in "how-to" works and the like. And you can't copyright "telling someone how to install a door".) Google may have copied the functionality, but that's perfectly legal, as long as they didn't copy the code. Which they didn't, except for the names.