Support testing null against null in equalsHelper()
[yangtools.git] / common / util / src / test / java / org / opendaylight / yangtools / util / EvenMoreObjectsTest.java
index 644f6e32df53ee61236bbde81770269e39ab023a..59bcd8521763bbe9e8e53e20d42ec8707461debf 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.yangtools.util;
 
+import static org.junit.Assert.assertTrue;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.testing.EqualsTester;
 import java.util.Objects;
@@ -15,7 +17,7 @@ import org.junit.Test;
 public class EvenMoreObjectsTest {
 
     @Test
-    public void test() {
+    public void thingPassesEqualsTester() {
         new EqualsTester()
                 .addEqualityGroup(new Thing("hello", 123), new Thing("hello", 123))
                 .addEqualityGroup(new Thing("hoi", 123), new Thing("hoi", 123))
@@ -24,7 +26,12 @@ public class EvenMoreObjectsTest {
                 .testEquals();
     }
 
-    static class Thing {
+    @Test
+    public void nullEqualsNull() {
+        assertTrue(EvenMoreObjects.equalsHelper(null, null, (one, another) -> true));
+    }
+
+    private static class Thing {
 
         String name;
         Integer age;