EntityUtil { public static boolean areEqualByIdAndType(EntityModel leftEntityModel, EntityModel rightEntityModel) { return Objects.equals(leftEntityModel.getType(), rightEntityModel.getType()) && Objects.equals(leftEntityModel.getId(), rightEntityModel.getId()); }  static boolean areEqualByIdAndType(EntityModel leftEntityModel, EntityModel rightEntityModel); static boolean areEqualByContent(EntityModel leftEntityModel, EntityModel rightEntityModel); static boolean areFieldModelsEqualByContent(FieldModel leftFieldModel, FieldModel rightFieldModel); static boolean containsEntityModel(Collection<EntityModel> collection, EntityModel entityModel); static boolean containsEntityModel(Collection<EntityModel> collection, EntityModel entityModel, EntityEquator entityEquator); static boolean containsAllEntityModels(Collection<EntityModel> baseCollection, Collection<EntityModel> sourceCollection, EntityEquator entityEquator); static boolean containsSameEntities(Collection<EntityModel> leftCollection, Collection<EntityModel> rightCollection, EntityEquator entityEquator); static boolean removeEntityModel(Collection<EntityModel> collection, EntityModel entityModel); static boolean removeEntityModel(Collection<EntityModel> collection, EntityModel entityModel, EntityEquator entityEquator);  }
@Test public void testEntityModelEqualsByIdAndType() { EntityModel entityModelOne = new EntityModel(); EntityModel entityModelTwo = new EntityModel(); assertTrue(EntityUtil.areEqualByIdAndType(entityModelOne, entityModelTwo)); entityModelOne.setValue(new StringFieldModel("id", "ID_HERE")); entityModelTwo.setValue(new StringFieldModel("id", "ID_HERE")); assertTrue(EntityUtil.areEqualByIdAndType(entityModelOne, entityModelTwo)); entityModelOne.setValue(new StringFieldModel("type", "work_item")); entityModelTwo.setValue(new StringFieldModel("type", "work_item")); assertTrue(EntityUtil.areEqualByIdAndType(entityModelOne, entityModelTwo)); entityModelOne.setValue(new StringFieldModel("type", "test")); assertFalse(EntityUtil.areEqualByIdAndType(entityModelOne, entityModelTwo)); entityModelOne.setValue(new StringFieldModel("type", "work_item")); entityModelOne.setValue(new StringFieldModel("id", "NEW_ID")); assertFalse(EntityUtil.areEqualByIdAndType(entityModelOne, entityModelTwo)); }