Skip to content

Commit 15c0384

Browse files
authored
Add 'equals' and 'hashcode' methods (#67)
1 parent 0a37387 commit 15c0384

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/com/nordstrom/automation/junit/AtomicTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static com.nordstrom.automation.junit.LifecycleHooks.invoke;
44

55
import java.util.List;
6+
import java.util.Objects;
67

78
import org.junit.After;
89
import org.junit.AfterClass;
@@ -121,4 +122,24 @@ public boolean includes(T method) {
121122
public String toString() {
122123
return description.toString();
123124
}
125+
126+
/**
127+
* {@inheritDoc}
128+
*/
129+
@Override
130+
public boolean equals(Object o) {
131+
if (this == o) return true;
132+
if (o == null || getClass() != o.getClass()) return false;
133+
AtomicTest<T> that = (AtomicTest<T>) o;
134+
return Objects.equals(runner, that.runner) &&
135+
Objects.equals(identity, that.identity);
136+
}
137+
138+
/**
139+
* {@inheritDoc}
140+
*/
141+
@Override
142+
public int hashCode() {
143+
return Objects.hash(runner, identity);
144+
}
124145
}

0 commit comments

Comments
 (0)