Skip to content

Commit

Permalink
Add 'equals' and 'hashcode' methods (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbabcoc authored Apr 21, 2020
1 parent 0a37387 commit 15c0384
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/com/nordstrom/automation/junit/AtomicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static com.nordstrom.automation.junit.LifecycleHooks.invoke;

import java.util.List;
import java.util.Objects;

import org.junit.After;
import org.junit.AfterClass;
Expand Down Expand Up @@ -121,4 +122,24 @@ public boolean includes(T method) {
public String toString() {
return description.toString();
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AtomicTest<T> that = (AtomicTest<T>) o;
return Objects.equals(runner, that.runner) &&
Objects.equals(identity, that.identity);
}

/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return Objects.hash(runner, identity);
}
}

0 comments on commit 15c0384

Please sign in to comment.