|
2 | 2 | */ |
3 | 3 | package org.hamcrest.core; |
4 | 4 |
|
5 | | -import static org.hamcrest.core.IsSame.same; |
| 5 | +import static org.hamcrest.core.IsSame.sameInstance; |
6 | 6 | import static org.hamcrest.core.IsNot.not; |
7 | 7 | import org.hamcrest.AbstractMatcherTest; |
8 | 8 | import org.hamcrest.Matcher; |
|
12 | 12 | public class IsSameTest extends AbstractMatcherTest { |
13 | 13 |
|
14 | 14 | protected Matcher<?> createMatcher() { |
15 | | - return same("irrelevant"); |
| 15 | + return sameInstance("irrelevant"); |
16 | 16 | } |
17 | 17 |
|
18 | 18 | public void testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject() { |
19 | 19 | Object o1 = new Object(); |
20 | 20 | Object o2 = new Object(); |
21 | 21 |
|
22 | | - assertThat(o1, same(o1)); |
23 | | - assertThat(o2, not(same(o1))); |
| 22 | + assertThat(o1, sameInstance(o1)); |
| 23 | + assertThat(o2, not(sameInstance(o1))); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | public void testReturnsReadableDescriptionFromToString() { |
27 | | - assertDescription("same(\"ARG\")", same("ARG")); |
| 27 | + assertDescription("same(\"ARG\")", sameInstance("ARG")); |
28 | 28 | } |
29 | 29 |
|
30 | 30 | public void testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull() { |
31 | | - assertDescription("same(null)", same(null)); |
| 31 | + assertDescription("same(null)", sameInstance(null)); |
32 | 32 | } |
33 | 33 | } |
0 commit comments