At first glance this looks like a bug to me. I think you want to do: placed = grid.set(new Door(), p);