diff --git a/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java index 3db817391..6e4d90369 100644 --- a/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java @@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.commons.lang3.AbstractLangTest; import org.apache.commons.lang3.ArrayUtils; @@ -216,6 +217,16 @@ public class DiffBuilderTest extends AbstractLangTest { assertEquals("prop1.int", list.getDiffs().get(0).getFieldName()); } + @Test + public void testDiffResultEquals() { + final TypeTestClass class1 = new TypeTestClass(); + class1.intField = 2; + + final DiffResult list = new DiffBuilder<>(class1, class1, SHORT_STYLE).append("prop1", class1.diff(class1)).build(); + assertEquals(0, list.getNumberOfDiffs()); + assertTrue(list.getDiffs().isEmpty()); + } + @Test public void testDouble() { final TypeTestClass class1 = new TypeTestClass();