He was sending nudes to that other nurse <| sep |> Breadthfirstsearch is a fun one . It ' s often the worst performing , but the thing I like about it the first solution it finds is always the shortest possible route . It ' s simultaneously lovely and idiotic . Anyway , A for lyfe . <| sep |> I quite recently refactored our repository layer which we sort of built ourselves because of the reason I gave below into always returning optionals instead of null values . Makes the code using the repositories much more elegant User user repository . findByIdfoo . o r E l s e T h r o w U serNotFoundExceptionnewAs opposed to the if block with the null check . Not to mention that optional also has the neat ifPresent map flatMap methods . I would strongly recommend adopting that pattern .