java - are `Matchers.hasItem` and `Matchers.contains` the same? -


i saw post

about difference between:

matchers.hasitem(..)  assert.assertthat(items, matchers.hasitem(matchers.hastostring("c"))); states 

and

matchers.contains 

but still don't difference. both 1 predicate satisfaction. no?

they same, matchers.hasitem said

will stop matching item found

then matchers.contains

the examined iterable must yield 1 item

the difference first 1 checks whether there @ least 1 item (may 2 or more), second 1 checks there 1 item (only one, no more).


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -