Fix Branch.equals to use Branch[_] in its type comparisons
Add a recipe for overriding equals on non-final classes