@Test public void testDifferentIdPojoDoesNotEqual() { GitHubRepository repo1 = new GitHubRepository(100, "", 10, 10, OWNER); GitHubRepository repo2 = new GitHubRepository(200, "", 10, 10, OWNER); assertFalse(repo1.equals(repo2)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; GitHubRepository that = (GitHubRepository) o; if (id != that.id) return false; if (stargazersCount != that.stargazersCount) return false; if (forksCount != that.forksCount) return false; if (!name.equals(that.name)) return false; return owner.equals(that.owner); }
GitHubRepository extends OverwritablePojo<GitHubRepository> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; GitHubRepository that = (GitHubRepository) o; if (id != that.id) return false; if (stargazersCount != that.stargazersCount) return false; if (forksCount != that.forksCount) return false; if (!name.equals(that.name)) return false; return owner.equals(that.owner); } }
GitHubRepository extends OverwritablePojo<GitHubRepository> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; GitHubRepository that = (GitHubRepository) o; if (id != that.id) return false; if (stargazersCount != that.stargazersCount) return false; if (forksCount != that.forksCount) return false; if (!name.equals(that.name)) return false; return owner.equals(that.owner); } GitHubRepository(int id,
                            @NonNull final String name,
                            int stargazersCount,
                            int forksCount,
                            @NonNull final GitHubOwner owner);  GitHubRepository(@NonNull final GitHubRepository other); }
GitHubRepository extends OverwritablePojo<GitHubRepository> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; GitHubRepository that = (GitHubRepository) o; if (id != that.id) return false; if (stargazersCount != that.stargazersCount) return false; if (forksCount != that.forksCount) return false; if (!name.equals(that.name)) return false; return owner.equals(that.owner); } GitHubRepository(int id,
                            @NonNull final String name,
                            int stargazersCount,
                            int forksCount,
                            @NonNull final GitHubOwner owner);  GitHubRepository(@NonNull final GitHubRepository other); @NonNull static GitHubRepository none(); boolean isSome(); int getId(); @NonNull String getName(); int getStargazersCount(); int getForksCount(); @NonNull GitHubOwner getOwner(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
GitHubRepository extends OverwritablePojo<GitHubRepository> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; GitHubRepository that = (GitHubRepository) o; if (id != that.id) return false; if (stargazersCount != that.stargazersCount) return false; if (forksCount != that.forksCount) return false; if (!name.equals(that.name)) return false; return owner.equals(that.owner); } GitHubRepository(int id,
                            @NonNull final String name,
                            int stargazersCount,
                            int forksCount,
                            @NonNull final GitHubOwner owner);  GitHubRepository(@NonNull final GitHubRepository other); @NonNull static GitHubRepository none(); boolean isSome(); int getId(); @NonNull String getName(); int getStargazersCount(); int getForksCount(); @NonNull GitHubOwner getOwner(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }