code: public static String printCollectionAware(final Object object, final boolean printBody) {
  
          if (!printBody) {
              return PRINT_HIDDEN;
          }
  
          if (object == null) {
              return String.valueOf(object);
          }
  
          Class<?> clazz = object.getClass();
          if (!Collection.class.isAssignableFrom(clazz)) {
              return String.valueOf(object);
          }
  
          return new StringBuilder().append("[<")
                                    .append(clazz.getSimpleName())
                                    .append("> size = ")
                                    .append(Collection.class.cast(object).size()).append("]")
                                    .toString();
      }
docs: Gets object representation with size for collection case.
  
  @param object    object instance to log
  @param printBody if {@code true} then prevent object string representation
  @return object representation with size for collection case