diff --git a/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java b/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java index d6e5f6b7c..b09c84020 100644 --- a/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java @@ -425,4 +425,24 @@ public class Flat3MapTest extends AbstractIterableMapTest { assertEquals( Integer.valueOf(0), m.remove( Integer.valueOf(0) ) ); } + public void testToString() { + final Flat3Map m = new Flat3Map(); + final String string0 = m.toString(); + assertNotNull(string0); + m.put( Integer.valueOf(1), Integer.valueOf(1) ); + final String string1 = m.toString(); + assertNotNull(string1); + assertNotSame(string0, string1); + m.put( Integer.valueOf(0), Integer.valueOf(0) ); + final String string2 = m.toString(); + assertNotNull(string2); + assertNotSame(string0, string2); + assertNotSame(string1, string2); + m.put( Integer.valueOf(2), Integer.valueOf(2) ); + final String string3 = m.toString(); + assertNotNull(string3); + assertNotSame(string0, string3); + assertNotSame(string1, string3); + assertNotSame(string2, string3); + } }