Comment by conradev
So long as the specific code used to implement a method is different, anyone is free under the Copyright Act to write his or her own code to carry out exactly the same function or specification of any methods used in the Java API. It does not matter that the declaration or method header lines are identical.
Emulators often require handling copyrighted materials like games or firmware, whereas APIs are not copyrightable.https://en.m.wikipedia.org/wiki/Google_LLC_v._Oracle_America...
The NES itself contains no code. Any NES emulator that ships with no software, or software under proper license (such as homebrew) is unambiguously legal. Does your PC, and the OS that drives it, suddenly become inherently illegal if you, as a user, installed pirated software? No, of course not.