IANAL, but as far as I understand it, the theory is that you commit copyright infringement if you copy, that is, you don&#x27;t come up with the code by yourself (whether you type it or use a copying tool is irrelevant).<p>How the courts go about <i>deciding</i> whether you actually copied is tricky; it involves actual evidence (emails, testimonial, etc) and common sense, often in the form of expert opinions (you probably didn&#x27;t just happen to write a 30 kLOC library that implements everything the same way, with just different variable names).<p>Now, there is a threshold of originality, that is, if there&#x27;s only obvious way to write something, it shouldn&#x27;t be infringing. But considering that rangeCheck() was considered to be infringing (see <i>Oracle v. Google</i>), I&#x27;m not sure we can depend on that. Then again, the guy did testify he actually copied it.