Transcribing a book verbatim is copying a specific creative expression, and is not necessary to make a book that closely competes with Harry Potter. Copying APIs is copying a utilitarian feature of software, and is absolutely necessary for compatibility/integrability purposes.
The thing is, copyright only protects specific creative expressions inherent in works, not ideas, themes or factual/utilitarian features (see patents). So Oracle is making a false equivalency here. It will be interesting to see if the court buys it, but case law in the USA already is pretty much settled that APIs are not copyrightable.