I am currently using FEST or AssertJ for assertion. and I run into a knot that I want to assert the flowing array:
[1,2,2,2,2,2,2]
So how do I write the assertion like
assertThat(arr).contains(1,atIndex(0)).containsTheOthers(2)
I don't see containsOthers in FEST or I miss something equal? I am a bit surprise FEST or AssertJ can't assert a range of index start from some designated index, since them emphasize on fluent concise assertion code. or is there good alternative?
As far I have to separate it into two asserts and manually fetch out first element to check and the n fetch out the others to check,totally three lines. That's a mess.
assertThat(arr[0]).contains(1,atIndex(0));
Arrays.copyOfRange(arr,1,arr.length);
assertThat(arr).containsOnly(2);