//System.out.println(properties.length);
for (int i = 0; i < properties.length; i++) {
String pName = properties[i].getName();
//System.out.println(pName);
Property p = bd.getProperty(pName);
Method m = p.getAccessorMethod();
if (m != null) { // ensure it has a getter method
Object value = m.invoke(bean, null);
if(!printed.contains(value)){
printed.add(value);
printProperty(sb, prefix + "." + pName, value);
}
}