Here you can find the source of identityToString(StringBuffer buffer, Object object)
public static void identityToString(StringBuffer buffer, Object object)
//package com.java2s; //License from project: Mozilla Public License public class Main { public static String identityToString(Object object) { if (object == null) { return null; }// w w w . j ava 2 s .com StringBuffer buffer = new StringBuffer(); identityToString(buffer, object); return buffer.toString(); } public static void identityToString(StringBuffer buffer, Object object) { if (object == null) { throw new NullPointerException("Cannot get the toString of a null identity"); } buffer.append(object.getClass().getName()).append('@') .append(Integer.toHexString(System.identityHashCode(object))); } public static String toString(Object obj) { return obj == null ? "" : obj.toString(); } public static String toString(Object obj, String nullStr) { return obj == null ? nullStr : obj.toString(); } }