From c3eee542bbc00d3e9292fb04ec55ed0ddfa39e3f Mon Sep 17 00:00:00 2001
From: Lars Johansson <lars.johansson@ess.eu>
Date: Fri, 5 Apr 2024 14:49:59 +0200
Subject: [PATCH] Fix constructor for structure classes and add unit tests

Work in progress.

Note that commit is thirteenth step in introducing audit tables.
---
 .../names/repository/model/DeviceGroup.java   |   2 +-
 .../names/repository/model/DeviceType.java    |   2 +-
 .../names/repository/model/Subsystem.java     |   2 +-
 .../names/repository/model/System.java        |   2 +-
 .../names/repository/model/AuditNameTest.java | 115 +++++++++++++++++-
 .../repository/model/AuditStructureTest.java  |  83 ++++++++++++-
 .../repository/model/DeviceGroupTest.java     |  78 +++++++++++-
 .../repository/model/DeviceTypeTest.java      |  78 +++++++++++-
 .../repository/model/DisciplineTest.java      |  71 ++++++++++-
 .../names/repository/model/NameTest.java      |  92 ++++++++++++++
 .../names/repository/model/StructureTest.java |  64 ++++++++++
 .../names/repository/model/SubsystemTest.java |  78 +++++++++++-
 .../repository/model/SystemGroupTest.java     |  71 ++++++++++-
 .../names/repository/model/SystemTest.java    |  78 +++++++++++-
 .../NameElementCommandConfirmTest.java        |   5 +
 .../element/NameElementCommandCreateTest.java |  16 +++
 .../beans/element/NameElementCommandTest.java |  21 ++++
 .../element/NameElementCommandUpdateTest.java |  57 ++++++---
 .../rest/beans/element/NameElementTest.java   |  97 +++++++++++++++
 .../StructureElementCommandConfirmTest.java   |  13 ++
 .../StructureElementCommandCreateTest.java    |  21 ++++
 .../element/StructureElementCommandTest.java  |  26 ++++
 .../StructureElementCommandUpdateTest.java    |  26 ++++
 .../beans/element/StructureElementTest.java   |  97 +++++++++++++++
 24 files changed, 1159 insertions(+), 36 deletions(-)

diff --git a/src/main/java/org/openepics/names/repository/model/DeviceGroup.java b/src/main/java/org/openepics/names/repository/model/DeviceGroup.java
index c1a45f38..b1b1f331 100644
--- a/src/main/java/org/openepics/names/repository/model/DeviceGroup.java
+++ b/src/main/java/org/openepics/names/repository/model/DeviceGroup.java
@@ -91,7 +91,7 @@ public class DeviceGroup extends Structure {
                 auditStructure.getMnemonic(), auditStructure.getMnemonicEquivalence(), auditStructure.getOrdering(), auditStructure.getDescription(),
                 auditStructure.getStatus(), auditStructure.isDeleted(),
                 auditStructure.getProcessed(), auditStructure.getProcessedBy(), auditStructure.getProcessedComment());
-        setParentId(parentId);
+        setParentId(auditStructure.getParentId());
         this.id = auditStructure.getId();
     }
 
diff --git a/src/main/java/org/openepics/names/repository/model/DeviceType.java b/src/main/java/org/openepics/names/repository/model/DeviceType.java
index 04d3c841..85b5b233 100644
--- a/src/main/java/org/openepics/names/repository/model/DeviceType.java
+++ b/src/main/java/org/openepics/names/repository/model/DeviceType.java
@@ -91,7 +91,7 @@ public class DeviceType extends Structure {
                 auditStructure.getMnemonic(), auditStructure.getMnemonicEquivalence(), auditStructure.getOrdering(), auditStructure.getDescription(),
                 auditStructure.getStatus(), auditStructure.isDeleted(),
                 auditStructure.getProcessed(), auditStructure.getProcessedBy(), auditStructure.getProcessedComment());
-        setParentId(parentId);
+        setParentId(auditStructure.getParentId());
         this.id = auditStructure.getId();
     }
 
diff --git a/src/main/java/org/openepics/names/repository/model/Subsystem.java b/src/main/java/org/openepics/names/repository/model/Subsystem.java
index 1e61ba76..dc004f92 100644
--- a/src/main/java/org/openepics/names/repository/model/Subsystem.java
+++ b/src/main/java/org/openepics/names/repository/model/Subsystem.java
@@ -91,7 +91,7 @@ public class Subsystem extends Structure {
                 auditStructure.getMnemonic(), auditStructure.getMnemonicEquivalence(), auditStructure.getOrdering(), auditStructure.getDescription(),
                 auditStructure.getStatus(), auditStructure.isDeleted(),
                 auditStructure.getProcessed(), auditStructure.getProcessedBy(), auditStructure.getProcessedComment());
-        setParentId(parentId);
+        setParentId(auditStructure.getParentId());
         this.id = auditStructure.getId();
     }
 
diff --git a/src/main/java/org/openepics/names/repository/model/System.java b/src/main/java/org/openepics/names/repository/model/System.java
index cd7a836a..9a85ac04 100644
--- a/src/main/java/org/openepics/names/repository/model/System.java
+++ b/src/main/java/org/openepics/names/repository/model/System.java
@@ -92,7 +92,7 @@ public class System extends Structure {
                 auditStructure.getMnemonic(), auditStructure.getMnemonicEquivalence(), auditStructure.getOrdering(), auditStructure.getDescription(),
                 auditStructure.getStatus(), auditStructure.isDeleted(),
                 auditStructure.getProcessed(), auditStructure.getProcessedBy(), auditStructure.getProcessedComment());
-        setParentId(parentId);
+        setParentId(auditStructure.getParentId());
         this.id = auditStructure.getId();
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/AuditNameTest.java b/src/test/java/org/openepics/names/repository/model/AuditNameTest.java
index 5ff3b8f3..d1e9df2e 100644
--- a/src/test/java/org/openepics/names/repository/model/AuditNameTest.java
+++ b/src/test/java/org/openepics/names/repository/model/AuditNameTest.java
@@ -84,14 +84,127 @@ class AuditNameTest {
                 null, "Acc", "ACC", null,
                 Status.APPROVED, false,
                 date, "test who", null);
+        aun1 = new AuditName("auditOperation", n1);
+        assertNotEquals(aun1, aun2);
+
+        n1 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun1 = new AuditName("auditOperation", n1);
+        assertNotEquals(aun1, aun2);
+
         n2 = new Name(
                 UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
                 null, "Acc", "ACC", null,
                 Status.APPROVED, false,
                 date, "test who", null);
-        aun1 = new AuditName("auditOperation", n1);
         aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 2L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, 1L, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, 1L, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, 1L,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                "010", "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acd", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACD", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", "description 2",
+                Status.APPROVED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
 
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.REJECTED, false,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, true,
+                date, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                null, "test who", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who 2", null);
+        aun2 = new AuditName("auditOperation", n2);
+        assertNotEquals(aun1, aun2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
+        aun2 = new AuditName("auditOperation", n2);
         assertNotEquals(aun1, aun2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/AuditStructureTest.java b/src/test/java/org/openepics/names/repository/model/AuditStructureTest.java
index 19a36d41..96140da9 100644
--- a/src/test/java/org/openepics/names/repository/model/AuditStructureTest.java
+++ b/src/test/java/org/openepics/names/repository/model/AuditStructureTest.java
@@ -84,14 +84,95 @@ class AuditStructureTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        aus1 = new AuditStructure("auditOperation", s1);
+        assertNotEquals(aus1, aus2);
+
         s2 = new System(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-        aus1 = new AuditStructure("auditOperation", s1);
         aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 2L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
 
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        aus2 = new AuditStructure("auditOperation", s2);
+        assertNotEquals(aus1, aus2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
+        aus2 = new AuditStructure("auditOperation", s2);
         assertNotEquals(aus1, aus2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/DeviceGroupTest.java b/src/test/java/org/openepics/names/repository/model/DeviceGroupTest.java
index b83f1180..e94fee24 100644
--- a/src/test/java/org/openepics/names/repository/model/DeviceGroupTest.java
+++ b/src/test/java/org/openepics/names/repository/model/DeviceGroupTest.java
@@ -54,17 +54,20 @@ class DeviceGroupTest {
                 "AA1", null, null, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-
         assertEquals(s1, s2);
+
+        AuditStructure aus1 = new AuditStructure("auditOperation", s1);
+        assertEquals(new DeviceGroup(aus1), s2);
     }
 
     @Test
     void equalsNoArgs() {
         DeviceGroup s1 = null, s2 = null;
 
+        assertEquals(s1, s2);
+
         s1 = new DeviceGroup();
         s2 = new DeviceGroup();
-
         assertEquals(s1, s2);
     }
 
@@ -78,12 +81,83 @@ class DeviceGroupTest {
                 "AA1", null, null, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new DeviceGroup(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
                 "AA1", null, null, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 2L,
+                "AA1", null, null, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA2", null, null, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", null, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, null, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, null, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, null, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, null, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, null, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", null, null, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/DeviceTypeTest.java b/src/test/java/org/openepics/names/repository/model/DeviceTypeTest.java
index 108dd439..f95c6e17 100644
--- a/src/test/java/org/openepics/names/repository/model/DeviceTypeTest.java
+++ b/src/test/java/org/openepics/names/repository/model/DeviceTypeTest.java
@@ -54,17 +54,20 @@ class DeviceTypeTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-
         assertEquals(s1, s2);
+
+        AuditStructure aus1 = new AuditStructure("auditOperation", s1);
+        assertEquals(new DeviceType(aus1), s2);
     }
 
     @Test
     void equalsNoArgs() {
         DeviceType s1 = null, s2 = null;
 
+        assertEquals(s1, s2);
+
         s1 = new DeviceType();
         s2 = new DeviceType();
-
         assertEquals(s1, s2);
     }
 
@@ -78,12 +81,83 @@ class DeviceTypeTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new DeviceType(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 2L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                 Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new DeviceType(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/DisciplineTest.java b/src/test/java/org/openepics/names/repository/model/DisciplineTest.java
index 5bf70b92..6009d29e 100644
--- a/src/test/java/org/openepics/names/repository/model/DisciplineTest.java
+++ b/src/test/java/org/openepics/names/repository/model/DisciplineTest.java
@@ -54,17 +54,20 @@ class DisciplineTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-
         assertEquals(s1, s2);
+
+        AuditStructure aus1 = new AuditStructure("auditOperation", s1);
+        assertEquals(new Discipline(aus1), s2);
     }
 
     @Test
     void equalsNoArgs() {
         Discipline s1 = null, s2 = null;
 
+        assertEquals(s1, s2);
+
         s1 = new Discipline();
         s2 = new Discipline();
-
         assertEquals(s1, s2);
     }
 
@@ -78,12 +81,76 @@ class DisciplineTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new Discipline(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Discipline(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/NameTest.java b/src/test/java/org/openepics/names/repository/model/NameTest.java
index ae18c677..86cfbb96 100644
--- a/src/test/java/org/openepics/names/repository/model/NameTest.java
+++ b/src/test/java/org/openepics/names/repository/model/NameTest.java
@@ -78,12 +78,104 @@ class NameTest {
                 null, "Acc", "ACC", null,
                 Status.APPROVED, false,
                 date, "test who", null);
+        assertNotEquals(n1, n2);
+
         n2 = new Name(
                 UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
                 null, "Acc", "ACC", null,
                 Status.APPROVED, false,
                 date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 2L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, 1L, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, 1L, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, 1L,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                "010", "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acd", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
 
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACD", null,
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", "description",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.REJECTED, false,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, true,
+                date, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                null, "test who", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who 2", null);
+        assertNotEquals(n1, n2);
+
+        n2 = new Name(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), 1L, null, null, null,
+                null, "Acc", "ACC", null,
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(n1, n2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/StructureTest.java b/src/test/java/org/openepics/names/repository/model/StructureTest.java
index fda3077d..35d511ec 100644
--- a/src/test/java/org/openepics/names/repository/model/StructureTest.java
+++ b/src/test/java/org/openepics/names/repository/model/StructureTest.java
@@ -78,12 +78,76 @@ class StructureTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new Structure(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Structure(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/SubsystemTest.java b/src/test/java/org/openepics/names/repository/model/SubsystemTest.java
index f6ce2532..98c5509a 100644
--- a/src/test/java/org/openepics/names/repository/model/SubsystemTest.java
+++ b/src/test/java/org/openepics/names/repository/model/SubsystemTest.java
@@ -54,17 +54,20 @@ class SubsystemTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-
         assertEquals(s1, s2);
+
+        AuditStructure aus1 = new AuditStructure("auditOperation", s1);
+        assertEquals(new Subsystem(aus1), s2);
     }
 
     @Test
     void equalsNoArgs() {
         Subsystem s1 = null, s2 = null;
 
+        assertEquals(s1, s2);
+
         s1 = new Subsystem();
         s2 = new Subsystem();
-
         assertEquals(s1, s2);
     }
 
@@ -78,12 +81,83 @@ class SubsystemTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new Subsystem(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 2L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new Subsystem(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/SystemGroupTest.java b/src/test/java/org/openepics/names/repository/model/SystemGroupTest.java
index 651f7ad6..3e74b73a 100644
--- a/src/test/java/org/openepics/names/repository/model/SystemGroupTest.java
+++ b/src/test/java/org/openepics/names/repository/model/SystemGroupTest.java
@@ -54,17 +54,20 @@ class SystemGroupTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-
         assertEquals(s1, s2);
+
+        AuditStructure aus1 = new AuditStructure("auditOperation", s1);
+        assertEquals(new SystemGroup(aus1), s2);
     }
 
     @Test
     void equalsNoArgs() {
         SystemGroup s1 = null, s2 = null;
 
+        assertEquals(s1, s2);
+
         s1 = new SystemGroup();
         s2 = new SystemGroup();
-
         assertEquals(s1, s2);
     }
 
@@ -78,12 +81,76 @@ class SystemGroupTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new SystemGroup(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new SystemGroup(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/repository/model/SystemTest.java b/src/test/java/org/openepics/names/repository/model/SystemTest.java
index b6c92018..9acb42c5 100644
--- a/src/test/java/org/openepics/names/repository/model/SystemTest.java
+++ b/src/test/java/org/openepics/names/repository/model/SystemTest.java
@@ -54,17 +54,20 @@ class SystemTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
-
         assertEquals(s1, s2);
+
+        AuditStructure aus1 = new AuditStructure("auditOperation", s1);
+        assertEquals(new System(aus1), s2);
     }
 
     @Test
     void equalsNoArgs() {
         System s1 = null, s2 = null;
 
+        assertEquals(s1, s2);
+
         s1 = new System();
         s2 = new System();
-
         assertEquals(s1, s2);
     }
 
@@ -78,12 +81,83 @@ class SystemTest {
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
         s2 = new System(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
                 "AA1", "AA1", 41, "description",
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 2L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA2", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA2", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 42, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description 2",
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(s1, s2);
 
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(s1, s2);
+
+        s2 = new System(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), 1L,
+                "AA1", "AA1", 41, "description",
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(s1, s2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandConfirmTest.java b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandConfirmTest.java
index 79dec121..021c874e 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandConfirmTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandConfirmTest.java
@@ -87,9 +87,14 @@ class NameElementCommandConfirmTest {
 
         ne1 = new NameElementCommandConfirm(
                 UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"));
+        assertNotEquals(ne1, ne2);
+
         ne2 = new NameElementCommandConfirm(
                 UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"));
+        assertNotEquals(ne1, ne2);
 
+        ne2 = new NameElementCommandConfirm(
+                null);
         assertNotEquals(ne1, ne2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandCreateTest.java b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandCreateTest.java
index 600e52b5..c892c322 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandCreateTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandCreateTest.java
@@ -90,10 +90,26 @@ class NameElementCommandCreateTest {
         ne1 = new NameElementCommandCreate(
                 UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), null,
                 null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
         ne2 = new NameElementCommandCreate(
                 UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), null,
                 null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommandCreate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"),
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
 
+        ne2 = new NameElementCommandCreate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), null,
+                "010", "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommandCreate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), null,
+                null, "System structure only 2");
         assertNotEquals(ne1, ne2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandTest.java b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandTest.java
index 649bb0fd..05fbe7e8 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandTest.java
@@ -90,10 +90,31 @@ class NameElementCommandTest {
         ne1 = new NameElementCommand(
                 UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
                 null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
         ne2 = new NameElementCommand(
                 UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
                 null, "System structure only");
+        assertNotEquals(ne1, ne2);
 
+        ne2 = new NameElementCommand(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), null,
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommand(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"),
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommand(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                "010", "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommand(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only 2");
         assertNotEquals(ne1, ne2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandUpdateTest.java b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandUpdateTest.java
index 99885321..995fb892 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandUpdateTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/NameElementCommandUpdateTest.java
@@ -46,11 +46,11 @@ class NameElementCommandUpdateTest {
         NameElementCommandUpdate ne1 = null, ne2 = null;
 
         ne1 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
         ne2 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
 
         assertEquals(ne1, ne2);
     }
@@ -88,12 +88,33 @@ class NameElementCommandUpdateTest {
         NameElementCommandUpdate ne1 = null, ne2 = null;
 
         ne1 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
         ne2 = new NameElementCommandUpdate(
-                UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
 
+        ne2 = new NameElementCommandUpdate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), null,
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommandUpdate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"),
+                null, "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommandUpdate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                "010", "System structure only");
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElementCommandUpdate(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only 2");
         assertNotEquals(ne1, ne2);
     }
 
@@ -132,11 +153,11 @@ class NameElementCommandUpdateTest {
         NameElementCommandUpdate ne1 = null, ne2 = null;
 
         ne1 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
         ne2 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
 
         assertNotNull(ne1);
         assertNotNull(ne2);
@@ -149,11 +170,11 @@ class NameElementCommandUpdateTest {
         NameElementCommandUpdate ne1 = null, ne2 = null;
 
         ne1 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
         ne2 = new NameElementCommandUpdate(
-                UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
 
         assertNotNull(ne1);
         assertNotNull(ne2);
@@ -166,8 +187,8 @@ class NameElementCommandUpdateTest {
         NameElementCommandUpdate ne1 = null;
 
         ne1 = new NameElementCommandUpdate(
-                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null,
-                "System structure only");
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only");
 
         String str = ne1.toString();
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java b/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java
index 9bc57087..0f0b35e2 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java
@@ -104,13 +104,110 @@ class NameElementTest {
                 "Acc", null, "Acc",
                 Status.APPROVED, false,
                 date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
         ne2 = new NameElement(
                 UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
                 null, "System structure only",
                 "Acc", null, "Acc",
                 Status.APPROVED, false,
                 date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), null,
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"),
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
 
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                "010", "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only 2",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acd", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", "Di", "Acc",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", null, "Acd",
+                Status.APPROVED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.REJECTED, false,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, true,
+                date, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                null, "test who", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who 2", null);
+        assertNotEquals(ne1, ne2);
+
+        ne2 = new NameElement(
+                UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null,
+                null, "System structure only",
+                "Acc", null, "Acc",
+                Status.APPROVED, false,
+                date, "test who", "test");
         assertNotEquals(ne1, ne2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandConfirmTest.java b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandConfirmTest.java
index 08e6ea68..c621bc96 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandConfirmTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandConfirmTest.java
@@ -88,9 +88,22 @@ class StructureElementCommandConfirmTest {
 
         se1 = new StructureElementCommandConfirm(
                 UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM);
+        assertNotEquals(se1, se2);
+
         se2 = new StructureElementCommandConfirm(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM);
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandConfirm(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SUBSYSTEM);
+        assertNotEquals(se1, se2);
 
+        se2 = new StructureElementCommandConfirm(
+                null, Type.SYSTEM);
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandConfirm(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), null);
         assertNotEquals(se1, se2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandCreateTest.java b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandCreateTest.java
index fdb45ae7..2faa79d1 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandCreateTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandCreateTest.java
@@ -91,10 +91,31 @@ class StructureElementCommandCreateTest {
         se1 = new StructureElementCommandCreate(
                 Type.SYSTEM, UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
                 "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandCreate(
+                Type.SUBSYSTEM, UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
         se2 = new StructureElementCommandCreate(
                 Type.SYSTEM, UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
                 "AA1", 41, "description");
+        assertNotEquals(se1, se2);
 
+        se2 = new StructureElementCommandCreate(
+                Type.SYSTEM, UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA2", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandCreate(
+                Type.SYSTEM, UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", 42, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandCreate(
+                Type.SYSTEM, UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", 41, "description 2");
         assertNotEquals(se1, se2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandTest.java b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandTest.java
index 385f6373..acbe9eda 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandTest.java
@@ -91,10 +91,36 @@ class StructureElementCommandTest {
         se1 = new StructureElementCommand(
                 UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
                 "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
         se2 = new StructureElementCommand(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
                 "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommand(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SUBSYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommand(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", 41, "description");
+        assertNotEquals(se1, se2);
 
+        se2 = new StructureElementCommand(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA2", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommand(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 42, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommand(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description 2");
         assertNotEquals(se1, se2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandUpdateTest.java b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandUpdateTest.java
index 7b093e82..c22b86cc 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandUpdateTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/StructureElementCommandUpdateTest.java
@@ -91,10 +91,36 @@ class StructureElementCommandUpdateTest {
         se1 = new StructureElementCommandUpdate(
                 UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
                 "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
         se2 = new StructureElementCommandUpdate(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
                 "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandUpdate(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SUBSYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandUpdate(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", 41, "description");
+        assertNotEquals(se1, se2);
 
+        se2 = new StructureElementCommandUpdate(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA2", 41, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandUpdate(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 42, "description");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElementCommandUpdate(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description 2");
         assertNotEquals(se1, se2);
     }
 
diff --git a/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java b/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java
index 8736aa1b..e9510295 100644
--- a/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java
+++ b/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java
@@ -105,13 +105,110 @@ class StructureElementTest {
                 "AA1", 2,
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
         se2 = new StructureElement(
                 UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
                 "AA1", 41, "description",
                 "AA1", 2,
                 Status.APPROVED, false,
                 date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SUBSYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
 
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA2", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 42, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description 2",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA2", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 3,
+                Status.APPROVED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.REJECTED, false,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, true,
+                date, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                null, "test who", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who 2", "comment");
+        assertNotEquals(se1, se2);
+
+        se2 = new StructureElement(
+                UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"),
+                "AA1", 41, "description",
+                "AA1", 2,
+                Status.APPROVED, false,
+                date, "test who", "comment 2");
         assertNotEquals(se1, se2);
     }
 
-- 
GitLab