A safer way to return a generic indicator object indicating failure
A fairly clean way is to use Optionals, like these or those. So you would make getNodeBefore return an Optional&lt;Node&lt;E&gt;&gt;. 

The badNode idea is, hm, exotic to me.