2

The documentation is identical:

Is using one version preferable to the others?

And from the comments it appears that there is a third version: org.hamcrest.Matchers.equalTo

Dan
  • 7,446
  • 6
  • 32
  • 46
  • 2
    Possible duplicate of [Difference between hamcrest-library Matchers and hamcrest-core CoreMatchers](http://stackoverflow.com/questions/10932941/difference-between-hamcrest-library-matchers-and-hamcrest-core-corematchers) – thegauravmahawar Nov 12 '15 at 14:55

1 Answers1

0

in fact they are the same.

CoreMatchers calls IsEqualMatcher

  public static <T> org.hamcrest.Matcher<T> equalTo(T operand) {
    return org.hamcrest.core.IsEqual.<T>equalTo(operand);
  }

To answer the question which one to use - it all depends on the code conventions employed in specific project.

WeMakeSoftware
  • 9,039
  • 5
  • 34
  • 52
  • Thanks, I hoped that they did actually all end up in the same place. Given that they do is there a reason to prefer one namespace over the others? Either conceptually or by convention? – Dan Nov 12 '15 at 15:02