From d74021c784675eb4e15c6e8df6e2b7971ae177f8 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Mon, 18 Dec 2017 17:22:45 +0100
Subject: [PATCH] unit tests simplified using mockito

---
 .../types/OperatorTypeUtilsTest.java          | 197 ++++++++----------
 .../reaction/AbstractNodeComparatorTest.java  | 108 +++++-----
 .../model/map/reaction/AndOperatorTest.java   | 168 ++++++++-------
 .../map/reaction/AssociationOperatorTest.java | 126 ++++++-----
 .../reaction/DissociationOperatorTest.java    | 126 ++++++-----
 .../model/map/reaction/NandOperatorTest.java  | 126 ++++++-----
 .../model/map/reaction/OrOperatorTest.java    | 126 ++++++-----
 .../model/map/reaction/ProductTest.java       | 107 +++++-----
 .../model/map/reaction/ReactantTest.java      | 107 +++++-----
 .../model/map/reaction/SplitOperatorTest.java | 126 ++++++-----
 .../map/reaction/TruncationOperatorTest.java  | 126 ++++++-----
 .../map/reaction/UnknownOperatorTest.java     | 131 ++++++------
 12 files changed, 749 insertions(+), 825 deletions(-)

diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/OperatorTypeUtilsTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/OperatorTypeUtilsTest.java
index 0e1a343a1b..a0cfa67eb8 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/OperatorTypeUtilsTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/OperatorTypeUtilsTest.java
@@ -10,123 +10,102 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.common.exception.InvalidStateException;
 import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.reaction.AbstractNode;
 import lcsb.mapviewer.model.map.reaction.Modifier;
 import lcsb.mapviewer.model.map.reaction.NodeOperator;
 
 public class OperatorTypeUtilsTest {
 
-	OperatorTypeUtils utils = new OperatorTypeUtils();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetUnknownOperatorTypeForClazz() {
-		OperatorType result = utils.getOperatorTypeForClazz(new NodeOperator() {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public AbstractNode copy() {
-				return null;
-			}
-
-			@Override
-			public String getOperatorText() {
-				return null;
-			}
-		}.getClass());
-
-		assertNull(result);
-	}
-
-	@Test
-	public void testGetUnkownOperatorTypeForStringType() {
-		OperatorType result = utils.getOperatorTypeForStringType("unknown");
-
-		assertNull(result);
-	}
-
-	@Test
-	public void testGetUnknownStringTypeByOperator() {
-		String result = utils.getStringTypeByOperator(new NodeOperator() {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public AbstractNode copy() {
-				return null;
-			}
-
-			@Override
-			public String getOperatorText() {
-				return null;
-			}
-		});
-
-		assertNull(result);
-	}
-
-	@Test
-	public void testCreateUnknownModifierForStringType() {
-		try {
-			utils.createModifierForStringType("blabla");
-			fail("Exceptione expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown modifier type"));
-		}
-	}
-
-	@Test
-	public void testCreateInvalidModifierForStringType() throws Exception {
-		// artificial implementation of Modifier that is invalid
-		class InvalidModifier extends Modifier {
-			private static final long serialVersionUID = 1L;
-
-			@SuppressWarnings("unused")
-			public InvalidModifier() {
-				throw new NotImplementedException();
-			}
-		}
-
-		// mopdify one of the elements of OperatorType so it will have invalid
-		// implementation
-		OperatorType typeToModify = OperatorType.AND_OPERATOR_STRING;
-		Class<? extends NodeOperator> clazz = typeToModify.getClazz();
-
-		try {
-			Field field = typeToModify.getClass().getDeclaredField("clazz");
-			field.setAccessible(true);
-			field.set(typeToModify, InvalidModifier.class);
-
-			// and check if we catch properly information about problematic
-			// implementation
-			utils.createModifierForStringType(typeToModify.getStringName());
-			fail("Exceptione expected");
-		} catch (InvalidStateException e) {
-			assertTrue(e.getMessage().contains("Problem with instantiation of NodeOperator class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			// restore correct values for the modified type (if not then other test
-			// might fail...)
-			Field field = typeToModify.getClass().getDeclaredField("clazz");
-			field.setAccessible(true);
-			field.set(typeToModify, clazz);
-		}
-	}
+  OperatorTypeUtils utils = new OperatorTypeUtils();
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+  }
+
+  @Before
+  public void setUp() throws Exception {
+  }
+
+  @After
+  public void tearDown() throws Exception {
+  }
+
+  @Test
+  public void testGetUnknownOperatorTypeForClazz() {
+
+    OperatorType result = utils
+        .getOperatorTypeForClazz(Mockito.mock(NodeOperator.class, Mockito.CALLS_REAL_METHODS).getClass());
+
+    assertNull(result);
+  }
+
+  @Test
+  public void testGetUnkownOperatorTypeForStringType() {
+    OperatorType result = utils.getOperatorTypeForStringType("unknown");
+
+    assertNull(result);
+  }
+
+  @Test
+  public void testGetUnknownStringTypeByOperator() {
+
+    String result = utils.getStringTypeByOperator(Mockito.mock(NodeOperator.class, Mockito.CALLS_REAL_METHODS));
+
+    assertNull(result);
+  }
+
+  @Test
+  public void testCreateUnknownModifierForStringType() {
+    try {
+      utils.createModifierForStringType("blabla");
+      fail("Exceptione expected");
+    } catch (InvalidArgumentException e) {
+      assertTrue(e.getMessage().contains("Unknown modifier type"));
+    }
+  }
+
+  @Test
+  public void testCreateInvalidModifierForStringType() throws Exception {
+    // artificial implementation of Modifier that is invalid
+    class InvalidModifier extends Modifier {
+      private static final long serialVersionUID = 1L;
+
+      @SuppressWarnings("unused")
+      public InvalidModifier() {
+        throw new NotImplementedException();
+      }
+    }
+
+    // mopdify one of the elements of OperatorType so it will have invalid
+    // implementation
+    OperatorType typeToModify = OperatorType.AND_OPERATOR_STRING;
+    Class<? extends NodeOperator> clazz = typeToModify.getClazz();
+
+    try {
+      Field field = typeToModify.getClass().getDeclaredField("clazz");
+      field.setAccessible(true);
+      field.set(typeToModify, InvalidModifier.class);
+
+      // and check if we catch properly information about problematic
+      // implementation
+      utils.createModifierForStringType(typeToModify.getStringName());
+      fail("Exceptione expected");
+    } catch (InvalidStateException e) {
+      assertTrue(e.getMessage().contains("Problem with instantiation of NodeOperator class"));
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    } finally {
+      // restore correct values for the modified type (if not then other test
+      // might fail...)
+      Field field = typeToModify.getClass().getDeclaredField("clazz");
+      field.setAccessible(true);
+      field.set(typeToModify, clazz);
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/AbstractNodeComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/AbstractNodeComparatorTest.java
index 6e01b620a4..acd1b78998 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/AbstractNodeComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/AbstractNodeComparatorTest.java
@@ -7,70 +7,58 @@ import static org.junit.Assert.fail;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.InvalidClassException;
 
 public class AbstractNodeComparatorTest {
 
-	public class Mock extends AbstractNode {
-
-		/**
-		 * 
-		 */
-		private static final long serialVersionUID = 1L;
-
-		@Override
-		public AbstractNode copy() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-	}
-
-	AbstractNodeComparator comparator = new AbstractNodeComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCompareException() {
-		try {
-			comparator.compare(new Mock(), new Mock());
-
-			fail("Exception should occur");
-		} catch (InvalidClassException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testCompareOk() {
-		try {
-			assertEquals(0, comparator.compare(new AndOperator(), new AndOperator()));
-			assertEquals(0, comparator.compare(null, null));
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			assertTrue(comparator.compare(new AndOperator(), null) != 0);
-			assertTrue(comparator.compare(null, new AndOperator()) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
+  AbstractNodeComparator comparator = new AbstractNodeComparator();
+
+  @Before
+  public void setUp() throws Exception {
+  }
+
+  @After
+  public void tearDown() throws Exception {
+  }
+
+  @Test
+  public void testCompareException() {
+    try {
+
+      comparator.compare(Mockito.mock(AbstractNode.class, Mockito.CALLS_REAL_METHODS),
+          Mockito.mock(AbstractNode.class, Mockito.CALLS_REAL_METHODS));
+
+      fail("Exception should occur");
+    } catch (InvalidClassException e) {
+
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail("Unkowne exception");
+    }
+  }
+
+  @Test
+  public void testCompareOk() {
+    try {
+      assertEquals(0, comparator.compare(new AndOperator(), new AndOperator()));
+      assertEquals(0, comparator.compare(null, null));
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail("Unkowne exception");
+    }
+  }
+
+  @Test
+  public void testDifferent() {
+    try {
+      assertTrue(comparator.compare(new AndOperator(), null) != 0);
+      assertTrue(comparator.compare(null, new AndOperator()) != 0);
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail("Unkowne exception");
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/AndOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/AndOperatorTest.java
index 586f91b930..4afb1e447a 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/AndOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/AndOperatorTest.java
@@ -9,96 +9,92 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class AndOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new AndOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			AndOperator op = new AndOperator();
-			op.setLine(new PolylineData());
-			AndOperator operator = new AndOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			AndOperator operator = new AndOperator();
-			assertFalse("".equals(new AndOperator().getSBGNOperatorText()));
-			assertFalse("".equals(operator.getOperatorText()));
-
-			NodeOperator nodeOperatorForInput = new AndOperator();
-			NodeOperator nodeOperatorForOutput = new AndOperator();
-
-			Reaction reaction = new Reaction();
-
-			operator.setReaction(reaction);
-			operator.setNodeOperatorForInput(nodeOperatorForInput);
-			operator.setNodeOperatorForOutput(nodeOperatorForOutput);
-
-			assertEquals(reaction, operator.getReaction());
-			assertEquals(nodeOperatorForInput, operator.getNodeOperatorForInput());
-			assertEquals(nodeOperatorForOutput, operator.getNodeOperatorForOutput());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy1() {
-		try {
-			AndOperator op = new AndOperator();
-			op.setLine(new PolylineData());
-			AndOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy2() {
-		try {
-			new AndOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
+
+  @After
+  public void tearDown() throws Exception {
+  }
+
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new AndOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  @Test
+  public void testConstructor() {
+    try {
+      AndOperator op = new AndOperator();
+      op.setLine(new PolylineData());
+      AndOperator operator = new AndOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  @Test
+  public void testGetters() {
+    try {
+      AndOperator operator = new AndOperator();
+      assertFalse("".equals(new AndOperator().getSBGNOperatorText()));
+      assertFalse("".equals(operator.getOperatorText()));
+
+      NodeOperator nodeOperatorForInput = new AndOperator();
+      NodeOperator nodeOperatorForOutput = new AndOperator();
+
+      Reaction reaction = new Reaction();
+
+      operator.setReaction(reaction);
+      operator.setNodeOperatorForInput(nodeOperatorForInput);
+      operator.setNodeOperatorForOutput(nodeOperatorForOutput);
+
+      assertEquals(reaction, operator.getReaction());
+      assertEquals(nodeOperatorForInput, operator.getNodeOperatorForInput());
+      assertEquals(nodeOperatorForOutput, operator.getNodeOperatorForOutput());
+
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  @Test
+  public void testCopy1() {
+    try {
+      AndOperator op = new AndOperator();
+      op.setLine(new PolylineData());
+      AndOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(AndOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/AssociationOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/AssociationOperatorTest.java
index 096cdc6369..2c2fd35775 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/AssociationOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/AssociationOperatorTest.java
@@ -8,82 +8,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class AssociationOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new AssociationOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new AssociationOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			AssociationOperator op = new AssociationOperator();
-			op.setLine(new PolylineData());
-			AssociationOperator operator = new AssociationOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      AssociationOperator op = new AssociationOperator();
+      op.setLine(new PolylineData());
+      AssociationOperator operator = new AssociationOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertFalse("".equals(new AssociationOperator().getSBGNOperatorText()));
-			assertFalse("".equals(new AssociationOperator().getOperatorText()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertFalse("".equals(new AssociationOperator().getSBGNOperatorText()));
+      assertFalse("".equals(new AssociationOperator().getOperatorText()));
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			AssociationOperator op = new AssociationOperator();
-			op.setLine(new PolylineData());
-			AssociationOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy1() {
+    try {
+      AssociationOperator op = new AssociationOperator();
+      op.setLine(new PolylineData());
+      AssociationOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new AssociationOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(AssociationOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/DissociationOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/DissociationOperatorTest.java
index fde2c74cd4..b548feb6dd 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/DissociationOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/DissociationOperatorTest.java
@@ -8,82 +8,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class DissociationOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new DissociationOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new DissociationOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			DissociationOperator op = new DissociationOperator();
-			op.setLine(new PolylineData());
-			DissociationOperator operator = new DissociationOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      DissociationOperator op = new DissociationOperator();
+      op.setLine(new PolylineData());
+      DissociationOperator operator = new DissociationOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertFalse("".equals(new DissociationOperator().getSBGNOperatorText()));
-			assertFalse("".equals(new DissociationOperator().getOperatorText()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertFalse("".equals(new DissociationOperator().getSBGNOperatorText()));
+      assertFalse("".equals(new DissociationOperator().getOperatorText()));
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			DissociationOperator op = new DissociationOperator();
-			op.setLine(new PolylineData());
-			DissociationOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy1() {
+    try {
+      DissociationOperator op = new DissociationOperator();
+      op.setLine(new PolylineData());
+      DissociationOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new DissociationOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(DissociationOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/NandOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/NandOperatorTest.java
index 53d56ce1a3..091ee853ba 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/NandOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/NandOperatorTest.java
@@ -8,82 +8,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class NandOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new NandOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new NandOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			NandOperator op = new NandOperator();
-			op.setLine(new PolylineData());
-			NandOperator operator = new NandOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      NandOperator op = new NandOperator();
+      op.setLine(new PolylineData());
+      NandOperator operator = new NandOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertFalse("".equals(new NandOperator().getSBGNOperatorText()));
-			assertFalse("".equals(new NandOperator().getOperatorText()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertFalse("".equals(new NandOperator().getSBGNOperatorText()));
+      assertFalse("".equals(new NandOperator().getOperatorText()));
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			NandOperator op = new NandOperator();
-			op.setLine(new PolylineData());
-			NandOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy1() {
+    try {
+      NandOperator op = new NandOperator();
+      op.setLine(new PolylineData());
+      NandOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new NandOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(NandOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/OrOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/OrOperatorTest.java
index cf29b85920..2b74c38dfe 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/OrOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/OrOperatorTest.java
@@ -8,82 +8,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class OrOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new OrOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new OrOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			OrOperator op = new OrOperator();
-			op.setLine(new PolylineData());
-			OrOperator operator = new OrOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      OrOperator op = new OrOperator();
+      op.setLine(new PolylineData());
+      OrOperator operator = new OrOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertFalse("".equals(new OrOperator().getSBGNOperatorText()));
-			assertFalse("".equals(new OrOperator().getOperatorText()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertFalse("".equals(new OrOperator().getSBGNOperatorText()));
+      assertFalse("".equals(new OrOperator().getOperatorText()));
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			OrOperator op = new OrOperator();
-			op.setLine(new PolylineData());
-			OrOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy1() {
+    try {
+      OrOperator op = new OrOperator();
+      op.setLine(new PolylineData());
+      OrOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new OrOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(OrOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ProductTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ProductTest.java
index 89aca1b92e..4f2e47b2e3 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ProductTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ProductTest.java
@@ -7,71 +7,66 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class ProductTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Product());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new Product());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			Product original = new Product();
-			original.setLine(new PolylineData());
-			Product product = new Product(original);
-			assertNotNull(product);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      Product original = new Product();
+      original.setLine(new PolylineData());
+      Product product = new Product(original);
+      assertNotNull(product);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy() {
-		try {
-			Product original = new Product();
-			original.setLine(new PolylineData());
-			Product product = original.copy();
-			assertNotNull(product);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy() {
+    try {
+      Product original = new Product();
+      original.setLine(new PolylineData());
+      Product product = original.copy();
+      assertNotNull(product);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Product() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testInvalidCopy() {
+    try {
+      Mockito.mock(Product.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactantTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactantTest.java
index 4de27c1a58..59c7379efb 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactantTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactantTest.java
@@ -7,72 +7,67 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class ReactantTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Reactant());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new Reactant());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			Reactant original = new Reactant();
-			original.setLine(new PolylineData());
-			Reactant reactant = new Reactant(original);
-			assertNotNull(reactant);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      Reactant original = new Reactant();
+      original.setLine(new PolylineData());
+      Reactant reactant = new Reactant(original);
+      assertNotNull(reactant);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy() {
-		try {
-			Reactant original = new Reactant();
-			original.setLine(new PolylineData());
-			Reactant reactant = original.copy();
-			assertNotNull(reactant);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy() {
+    try {
+      Reactant original = new Reactant();
+      original.setLine(new PolylineData());
+      Reactant reactant = original.copy();
+      assertNotNull(reactant);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Reactant() {
+  @Test
+  public void testInvalidCopy() {
+    try {
+      Mockito.mock(Reactant.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/SplitOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/SplitOperatorTest.java
index 510029a3a9..83c1ca3545 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/SplitOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/SplitOperatorTest.java
@@ -7,82 +7,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class SplitOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new SplitOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new SplitOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			SplitOperator op = new SplitOperator();
-			op.setLine(new PolylineData());
-			SplitOperator operator = new SplitOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      SplitOperator op = new SplitOperator();
+      op.setLine(new PolylineData());
+      SplitOperator operator = new SplitOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertNotNull(new SplitOperator().getSBGNOperatorText());
-			assertNotNull(new SplitOperator().getOperatorText());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertNotNull(new SplitOperator().getSBGNOperatorText());
+      assertNotNull(new SplitOperator().getOperatorText());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			SplitOperator op = new SplitOperator();
-			op.setLine(new PolylineData());
-			SplitOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy1() {
+    try {
+      SplitOperator op = new SplitOperator();
+      op.setLine(new PolylineData());
+      SplitOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new SplitOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(SplitOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/TruncationOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/TruncationOperatorTest.java
index a9ea3be433..544f27738f 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/TruncationOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/TruncationOperatorTest.java
@@ -7,82 +7,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class TruncationOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new TruncationOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new TruncationOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testConstructor() {
-		try {
-			TruncationOperator op = new TruncationOperator();
-			op.setLine(new PolylineData());
-			TruncationOperator operator = new TruncationOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      TruncationOperator op = new TruncationOperator();
+      op.setLine(new PolylineData());
+      TruncationOperator operator = new TruncationOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertNotNull(new TruncationOperator().getSBGNOperatorText());
-			assertNotNull(new TruncationOperator().getOperatorText());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertNotNull(new TruncationOperator().getSBGNOperatorText());
+      assertNotNull(new TruncationOperator().getOperatorText());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			TruncationOperator op = new TruncationOperator();
-			op.setLine(new PolylineData());
-			TruncationOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy1() {
+    try {
+      TruncationOperator op = new TruncationOperator();
+      op.setLine(new PolylineData());
+      TruncationOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new TruncationOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(TruncationOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
 }
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/UnknownOperatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/UnknownOperatorTest.java
index 2731cb1fe7..62bf1fdc82 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/UnknownOperatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/UnknownOperatorTest.java
@@ -8,83 +8,78 @@ import org.apache.commons.lang3.SerializationUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.model.graphics.PolylineData;
 
 public class UnknownOperatorTest {
 
-	@Before
-	public void setUp() throws Exception {
-	}
+  @Before
+  public void setUp() throws Exception {
+  }
 
-	@After
-	public void tearDown() throws Exception {
-	}
+  @After
+  public void tearDown() throws Exception {
+  }
 
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UnknownOperator());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	
-	@Test
-	public void testConstructor() {
-		try {
-			UnknownOperator op = new UnknownOperator();
-			op.setLine(new PolylineData());
-			UnknownOperator operator = new UnknownOperator(op);
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testSerialization() {
+    try {
+      SerializationUtils.serialize(new UnknownOperator());
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testGetters() {
-		try {
-			assertFalse("".equals(new UnknownOperator().getSBGNOperatorText()));
-			assertFalse("".equals(new UnknownOperator().getOperatorText()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testConstructor() {
+    try {
+      UnknownOperator op = new UnknownOperator();
+      op.setLine(new PolylineData());
+      UnknownOperator operator = new UnknownOperator(op);
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy1() {
-		try {
-			UnknownOperator op = new UnknownOperator();
-			op.setLine(new PolylineData());
-			UnknownOperator operator = op.copy();
-			assertNotNull(operator);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
+  @Test
+  public void testGetters() {
+    try {
+      assertFalse("".equals(new UnknownOperator().getSBGNOperatorText()));
+      assertFalse("".equals(new UnknownOperator().getOperatorText()));
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  @Test
+  public void testCopy1() {
+    try {
+      UnknownOperator op = new UnknownOperator();
+      op.setLine(new PolylineData());
+      UnknownOperator operator = op.copy();
+      assertNotNull(operator);
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  @Test
+  public void testCopy2() {
+    try {
+      Mockito.mock(UnknownOperator.class, Mockito.CALLS_REAL_METHODS).copy();
+      fail("Exception expected");
+    } catch (NotImplementedException e) {
+    } catch (Exception e) {
+      e.printStackTrace();
+      throw e;
+    }
+  }
 
-	@Test
-	public void testCopy2() {
-		try {
-			new UnknownOperator() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
 }
-- 
GitLab