From 10122741eac52e218771f30c6dc2c0aca54ff006 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 10 Nov 2017 11:54:14 -0700 Subject: [PATCH] Break up testIdentityToStringStringBuilder into multiple test methods. --- .../org/apache/commons/lang3/ObjectUtilsTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java index 445e5e2e7..06b97e2a0 100644 --- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java @@ -216,13 +216,21 @@ public class ObjectUtilsTest { final Integer i = Integer.valueOf(90); final String expected = "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i)); - assertEquals(expected, ObjectUtils.identityToString(i)); - final StringBuilder builder = new StringBuilder(); ObjectUtils.identityToString(builder, i); assertEquals(expected, builder.toString()); } + @Test + public void testIdentityToStringStringBuilderInUse() { + final Integer i = Integer.valueOf(90); + final String expected = "ABC = java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i)); + + final StringBuilder builder = new StringBuilder("ABC = "); + ObjectUtils.identityToString(builder, i); + assertEquals(expected, builder.toString()); + } + @Test public void testIdentityToStringStringBuilderNullValue() { try {