--- /dev/null
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.common;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import org.junit.Test;
+
+public class EmptyTest {
+
+ @Test
+ public void testInstanceNotNull() {
+ assertNotNull(Empty.getInstance());
+ }
+
+ @Test
+ public void testToString() {
+ assertEquals("empty", Empty.getInstance().toString());
+ }
+
+ @Test
+ public void testSerialization() throws IOException, ClassNotFoundException {
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
+ oos.writeObject(Empty.getInstance());
+ }
+
+ final Object read;
+ try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()))) {
+ read = ois.readObject();
+ }
+
+ assertSame(Empty.getInstance(), read);
+ }
+}