GitCommitResponse implements CommandResponse { public boolean equals(Object o) { if (!(o instanceof GitCommitResponse)) { return false; } GitCommitResponse g = (GitCommitResponse) o; if (!CheckUtilities.checkObjectsEqual(getCommitShortHashName(), g.getCommitShortHashName())) { return false; } if (!CheckUtilities.checkObjectsEqual(getCommitShortComment(), g.getCommitShortComment())) { return false; } if (getFilesChanged() != g.getFilesChanged()) { return false; } if (getLinesInserted() != g.getLinesInserted()) { return false; } if (getLinesDeleted() != g.getLinesDeleted()) { return false; } if (!CheckUtilities.checkUnorderedListsEqual(addedFiles, g.addedFiles)) { return false; } if (!CheckUtilities.checkUnorderedListsEqual(copiedFiles, g.copiedFiles)) { return false; } if (!CheckUtilities.checkUnorderedListsEqual(deletedFiles, g.deletedFiles)) { return false; } if (!CheckUtilities.checkUnorderedListsEqual(renamedFiles, g.renamedFiles)) { return false; } return true; } GitCommitResponse(Ref shortHashName, String shortComment); boolean equals(Object o); Iterator<AddedOrDeletedFile> getAddedFilesIterator(); String getCommitShortComment(); Ref getCommitShortHashName(); Iterator<CopiedOrMovedFile> getCopiedFilesIterator(); Iterator<AddedOrDeletedFile> getDeletedFilesIterator(); int getFilesChanged(); int getLinesInserted(); int getLinesDeleted(); Iterator<CopiedOrMovedFile> getRenamedFilesIterator(); int hashCode();  }
@Test public void testGitCommitResponseEqualsMethod() { assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.setFilesChanged(5); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.setFilesChanged(5); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.setLinesDeleted(403); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.setLinesDeleted(403); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.setLinesInserted(6423); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.setLinesInserted(6423); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.addAddedFile(new File("/some/path/to/file.txt"), "100644"); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.addAddedFile(new File("/some/path/to/file.txt"), "100644"); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.addDeletedFile(new File("/another/path/to/file.txt"), "100644"); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.addDeletedFile(new File("/another/path/to/file.txt"), "100644"); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.addCopiedFile(new File("/from/this/path.txt"), new File("/to/this/altered-path.txt"), 56); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.addCopiedFile(new File("/from/this/path.txt"), new File("/to/this/altered-path.txt"), 56); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); resp.addRenamedFile(new File("/from/another/path.txt"), new File("/to/another/altered-path.txt"), 23); assertTrue("GitCommitResponseObjects are equal when they should not be.", !resp .equals(respSame)); respSame.addRenamedFile(new File("/from/another/path.txt"), new File( "/to/another/altered-path.txt"), 23); assertEquals("GitCommitResponse objects are not equal when they should be", resp, respSame); }