FileIssueMetrics extends FileMetrics { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof FileIssueMetrics)) { return false; } final FileIssueMetrics other = (FileIssueMetrics) obj; return Objects.equals(fileIssue, other.fileIssue); } FileIssueMetrics(String file, String file2, IssueMetrics issueMetrics, double... metrics);  FileIssueMetrics(String file, String file2, Commit commit, IssueMetrics issueMetrics, double... metrics);  FileIssueMetrics(String file, String file2, Integer issue, double... metrics);  FileIssueMetrics(String file, String file2, Integer issue, List<Double> metrics); String getHeader(); FileIssue getFileIssue(); IssueMetrics getIssueMetrics(); int getChangedAfterReopened(); void setFileBChangedAfterReopened(int reopenedIndex); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final String HEADER; static final Map<String, Integer> headerIndexes; static final Integer futureDefectsIndex; }
@Test public void testEqualsTrue() { FileIssueMetrics m = new FileIssueMetrics("A.java", "B.java", new Commit(1, new Committer(1, "Foo", "Bar"), new Date()), new EmptyIssueMetrics()); FileIssueMetrics m2 = new FileIssueMetrics("A.java", "C.java", new Commit(1, new Committer(1, "Foo", "Bar"), new Date()), new EmptyIssueMetrics()); Assert.assertTrue(m.equals(m)); Assert.assertTrue(m2.equals(m2)); Assert.assertTrue(m.equals(m2)); Assert.assertTrue(m2.equals(m)); }
@Test public void testEqualsFalse() { FileIssueMetrics m = new FileIssueMetrics("A.java", "B.java", new Commit(1, new Committer(1, "Foo", "Bar"), new Date()), new EmptyIssueMetrics()); FileIssueMetrics m2 = new FileIssueMetrics("A.java", "B.java", new Commit(2, new Committer(1, "Foo", "Bar"), new Date()), new EmptyIssueMetrics()); Assert.assertFalse(m.equals(m2)); Assert.assertFalse(m2.equals(m)); }