fest-assert-2.x
fest-assert-2.x copied to clipboard
Make Fest Assertions more type safe
Each class/interface that has S (self type) parameter should specify an upper bound. it makes the code more type safe as the returned assertion object is considered by the compiler as the upper bound type.
This was done for EnumerableAssert :
public interface EnumerableAssert<S extends EnumerableAssert<S, T>, T>
As S extends EnumerableAssert, the compiler knows that the returned object in assertion (S) can be considered as of EnumerableAssert type.
We should od the same for ComparableAssert (and probably some other interface/class) :
public interface ComparableAssert<S, A extends Comparable<? super A>>
You meant
public interface ComparableAssert<S extends ComparableAssert<A>, A extends Comparable<? super A>>