fest-assert-2.x
fest-assert-2.x copied to clipboard
ListAssert inherits from IterableAssert and remove AbstractIterableAssert ?
I just remember of this TODO. For recall, ListAssert header is :
public class ListAssert<T> extends AbstractIterableAssert<ListAssert<T>, List<T>, T> implements IndexedObjectEnumerableAssert<T>
I think we should, there is not reason against and to have better logical hierarchy.
No, this will break returned self type on methods from IterableAssert in ListAssert (we loose S generic when extend).
I think we should move all the code from ListAssert to the new class AbstractListAssert and make ListAssert extend it. This will enable library users to extend AbstractListAssert (like other abstract assert classes) and take all assertions from it - this improves extensibility of lib.
Also, this "idea" is applicable to other assert implementations that do not have abstract classes. Maybe move all code from concrete classes to abstract ones (also respecting type hierarchy)?
@ash2k I tend to agree with you, let's start with ListAssert and AbstractListAssert, we will do the remaining classes later to avoid a too big workload.