Autoplayer argument


In the class autoplayer implementation that receives game, whenever I try to get a copy of the currentpiece, I get an error that says

java.lang.NullPointerException: Cannot invoke "" because the return value of "" is null at at tetris.autoplay.AutoPlayerImplementation.( at at at at java.base/

I have checked the clone() method in, it seems to work fine, and returns a new PieceImplementation. I’m not sure what I did wrong here.

It depends on the context you are calling the code in.
Have you written a test for this situation where you check that the object you expect to be not null is not null?
If this is the test output, is this behavior in the reference or in your implementation?