GeneOrthologModel implements GeneModel { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof GeneOrthologModel)) return false; GeneOrthologModel geneOrthologModel = (GeneOrthologModel) o; return entrezGeneId == geneOrthologModel.entrezGeneId && Objects.equals(modelId, geneOrthologModel.modelId) && organism == geneOrthologModel.organism && Objects.equals(humanGeneSymbol, geneOrthologModel.humanGeneSymbol) && Objects.equals(modelGeneId, geneOrthologModel.modelGeneId) && Objects.equals(modelGeneSymbol, geneOrthologModel.modelGeneSymbol) && Objects.equals(phenotypeIds, geneOrthologModel.phenotypeIds); } GeneOrthologModel(String modelId, Organism organism, int entrezGeneId, String humanGeneSymbol, String modelGeneId, String modelGeneSymbol, List<String> phenotypeIds); String getModelGeneId(); String getModelGeneSymbol(); @Override Organism getOrganism(); @Override Integer getEntrezGeneId(); @Override String getHumanGeneSymbol(); @Override String getId(); @Override List<String> getPhenotypeIds(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { GeneOrthologModel other = new GeneOrthologModel(modelId, organism, entrezGeneId, humanGeneSymbol, modelGeneId, modelGeneSymbol, modelPhenotypeIds); assertThat(instance.equals(other), is(true)); }
@Test public void testNotEqualsGeneId() { GeneOrthologModel other = new GeneOrthologModel(modelId, organism, 54321, humanGeneSymbol, modelGeneId, modelGeneSymbol, modelPhenotypeIds); assertThat(instance.equals(other), is(false)); }
@Test public void testNotEqualsGeneSymbol() { GeneOrthologModel other = new GeneOrthologModel(modelId, organism, entrezGeneId, "GENE2", modelGeneId, modelGeneSymbol, modelPhenotypeIds); assertThat(instance.equals(other), is(false)); }
@Test public void testNotEqualsModelId() { GeneOrthologModel other = new GeneOrthologModel("different_model", organism, entrezGeneId, humanGeneSymbol, modelGeneId, modelGeneSymbol, modelPhenotypeIds); assertThat(instance.equals(other), is(false)); }
@Test public void testNotEqualsPhenotypes() { GeneOrthologModel other = new GeneOrthologModel(modelId, organism, entrezGeneId, humanGeneSymbol, modelGeneId, modelGeneSymbol, null); assertThat(instance.equals(other), is(false)); }
@Test public void testNotEqualsOrganism() { GeneOrthologModel other = new GeneOrthologModel(modelId, Organism.HUMAN, entrezGeneId, humanGeneSymbol, modelId, modelGeneSymbol, null); assertThat(instance.equals(other), is(false)); }