The criteria for copyright is originality and creativity. [2] It doesn't matter if understanding hashcodes is hard. Mathematical functions are not copyrightable. [3] Whereas elegant vs inelegant APIs demonstrate there is creativity in the API design process. Google engineer Bob Lee agreed [4]
>Q. Would you say that designing APIs is a creative activity?
>THE WITNESS: Yes, absolutely.
Copyrights are not patents. Clean room designs are perfectly legal. [5] Google could have avoided the entire fight, but Google failed to prove they did a clean room design.
Quite the opposite, Oracle was able to show that Google made direct copies of the code. The evidence at trial showed that Google decompiled at least eight Java files and copied them each in their entirety. [6]
[1] https://arxiv.org/pdf/1605.05274.pdf
[2] https://copyright.uslegal.com/enumerated-categories-of-copyr...
[3] https://www.copyright.gov/circs/circ31.pdf
[4] http://www.groklaw.net/pdf3/OraGoogle-398(Ex3).pdf