From 5d83e4deb81aa7e06e4587809642e70ef9a03662 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Tue, 30 Apr 2013 19:09:01 +0000 Subject: [PATCH] Add some tests for toString git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1477781 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections4/map/Flat3MapTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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); + } }