@Test public void test_copy_participant_evidence_properties() { ParticipantEvidence sourceParticipant = new DefaultParticipantEvidence(InteractorUtils.createUnknownBasicInteractor()); sourceParticipant.setStoichiometry(new DefaultStoichiometry(3)); sourceParticipant .getCausalRelationships() .add( new DefaultCausalRelationship( new DefaultCvTerm("decrease"), new DefaultParticipant(new DefaultProtein("p1")))); sourceParticipant.setBiologicalRole(new DefaultCvTerm("enzyme")); sourceParticipant.getAliases().add(new DefaultAlias("test alias")); sourceParticipant.getXrefs().add(new DefaultXref(new DefaultCvTerm("test database"), "xxxx")); sourceParticipant .getAnnotations() .add(new DefaultAnnotation(new DefaultCvTerm("test comment"), "comment")); sourceParticipant.addFeature(new DefaultFeatureEvidence("test", "test feature")); sourceParticipant.setInteraction(new DefaultInteractionEvidence()); sourceParticipant.setExperimentalRole(new DefaultCvTerm("bait")); sourceParticipant.setExpressedInOrganism(new DefaultOrganism(-1)); sourceParticipant.getExperimentalPreparations().add(new DefaultCvTerm("test preparation")); sourceParticipant .getConfidences() .add(new DefaultConfidence(new DefaultCvTerm("author-score"), "high")); sourceParticipant .getParameters() .add(new DefaultParameter(new DefaultCvTerm("kd"), new ParameterValue(new BigDecimal(3)))); sourceParticipant.getIdentificationMethods().add(new DefaultCvTerm("test method")); ParticipantEvidence targetParticipant = new DefaultParticipantEvidence(new DefaultProtein("p2")); ParticipantCloner.copyAndOverrideParticipantEvidenceProperties( sourceParticipant, targetParticipant, false); Assert.assertEquals(1, targetParticipant.getXrefs().size()); Assert.assertEquals(1, targetParticipant.getAnnotations().size()); Assert.assertEquals(1, targetParticipant.getAliases().size()); Assert.assertEquals(1, targetParticipant.getFeatures().size()); Assert.assertEquals(1, targetParticipant.getParameters().size()); Assert.assertEquals(1, targetParticipant.getConfidences().size()); Assert.assertEquals(1, targetParticipant.getExperimentalPreparations().size()); Assert.assertEquals(1, targetParticipant.getIdentificationMethods().size()); Assert.assertNull(targetParticipant.getInteraction()); Assert.assertTrue( targetParticipant.getXrefs().iterator().next() == sourceParticipant.getXrefs().iterator().next()); Assert.assertTrue( targetParticipant.getAliases().iterator().next() == sourceParticipant.getAliases().iterator().next()); Assert.assertTrue( targetParticipant.getAnnotations().iterator().next() == sourceParticipant.getAnnotations().iterator().next()); Assert.assertTrue( targetParticipant.getFeatures().iterator().next() == sourceParticipant.getFeatures().iterator().next()); Assert.assertTrue(targetParticipant.getInteractor() == sourceParticipant.getInteractor()); Assert.assertTrue(targetParticipant.getStoichiometry() == sourceParticipant.getStoichiometry()); Assert.assertTrue( targetParticipant.getBiologicalRole() == sourceParticipant.getBiologicalRole()); Assert.assertTrue( targetParticipant.getCausalRelationships().iterator().next() == sourceParticipant.getCausalRelationships().iterator().next()); Assert.assertTrue( targetParticipant.getFeatures().iterator().next().getParticipant() == sourceParticipant); Assert.assertTrue( targetParticipant.getExperimentalRole() == sourceParticipant.getExperimentalRole()); Assert.assertTrue( targetParticipant.getExpressedInOrganism() == sourceParticipant.getExpressedInOrganism()); Assert.assertTrue( targetParticipant.getExperimentalPreparations().iterator().next() == sourceParticipant.getExperimentalPreparations().iterator().next()); Assert.assertTrue( targetParticipant.getConfidences().iterator().next() == sourceParticipant.getConfidences().iterator().next()); Assert.assertTrue( targetParticipant.getParameters().iterator().next() == sourceParticipant.getParameters().iterator().next()); Assert.assertTrue( targetParticipant.getIdentificationMethods().iterator().next() == sourceParticipant.getIdentificationMethods().iterator().next()); }