@Test public void isSameDifferentEntityTypeId() { EntityType thisEntityType = when(mock(EntityType.class).getId()).thenReturn("ThisEntityTypeId").getMock(); EntityType thatEntityType = when(mock(EntityType.class).getId()).thenReturn("ThatEntityTypeId").getMock(); String entityId = "MyEntityId"; Entity thisEntity = mock(Entity.class); when(thisEntity.getEntityType()).thenReturn(thisEntityType); when(thisEntity.getIdValue()).thenReturn(entityId); Entity thatEntity = mock(Entity.class); when(thatEntity.getEntityType()).thenReturn(thatEntityType); when(thatEntity.getIdValue()).thenReturn(entityId); assertFalse(EntityUtils.isSame(thisEntity, thatEntity)); }
public static boolean isSame(Entity thisEntity, Entity thatEntity) { return thisEntity == thatEntity || thisEntity.getIdValue().equals(thatEntity.getIdValue()) && thisEntity.getEntityType().getId().equals(thatEntity.getEntityType().getId()); }
EntityUtils { public static boolean isSame(Entity thisEntity, Entity thatEntity) { return thisEntity == thatEntity || thisEntity.getIdValue().equals(thatEntity.getIdValue()) && thisEntity.getEntityType().getId().equals(thatEntity.getEntityType().getId()); } }
EntityUtils { public static boolean isSame(Entity thisEntity, Entity thatEntity) { return thisEntity == thatEntity || thisEntity.getIdValue().equals(thatEntity.getIdValue()) && thisEntity.getEntityType().getId().equals(thatEntity.getEntityType().getId()); } private  EntityUtils(); }
EntityUtils { public static boolean isSame(Entity thisEntity, Entity thatEntity) { return thisEntity == thatEntity || thisEntity.getIdValue().equals(thatEntity.getIdValue()) && thisEntity.getEntityType().getId().equals(thatEntity.getEntityType().getId()); } private  EntityUtils(); static Object getTypedValue(String valueStr, Attribute attr); static Object getTypedValue(String valueStr, Attribute attr, EntityManager entityManager); static boolean equals(EntityType entityType, EntityType otherEntityType); static boolean equals(Iterable<Attribute> attrsIt, Iterable<Attribute> otherAttrsIt); static boolean equalsEntities(
      Iterable<Entity> entityIterable, Iterable<Entity> otherEntityIterable); static boolean equals(Tag tag, Tag otherTag); static boolean equals(Attribute attr, Attribute otherAttr); static boolean equals(Attribute attr, Attribute otherAttr, boolean checkIdentifier); static boolean equals(Entity entity, Entity otherEntity); static int hashCode(Entity entity); static boolean isNullValue(Entity entity, Attribute attribute); static boolean isSame(Entity thisEntity, Entity thatEntity); }
EntityUtils { public static boolean isSame(Entity thisEntity, Entity thatEntity) { return thisEntity == thatEntity || thisEntity.getIdValue().equals(thatEntity.getIdValue()) && thisEntity.getEntityType().getId().equals(thatEntity.getEntityType().getId()); } private  EntityUtils(); static Object getTypedValue(String valueStr, Attribute attr); static Object getTypedValue(String valueStr, Attribute attr, EntityManager entityManager); static boolean equals(EntityType entityType, EntityType otherEntityType); static boolean equals(Iterable<Attribute> attrsIt, Iterable<Attribute> otherAttrsIt); static boolean equalsEntities(
      Iterable<Entity> entityIterable, Iterable<Entity> otherEntityIterable); static boolean equals(Tag tag, Tag otherTag); static boolean equals(Attribute attr, Attribute otherAttr); static boolean equals(Attribute attr, Attribute otherAttr, boolean checkIdentifier); static boolean equals(Entity entity, Entity otherEntity); static int hashCode(Entity entity); static boolean isNullValue(Entity entity, Attribute attribute); static boolean isSame(Entity thisEntity, Entity thatEntity);  }