@Test public void testObjectToStringWhenNull() { assertNull(sut.objectToString(null)); }
@SuppressWarnings("unchecked") @Override public String objectToString(final Object listObj) { if (listObj == null || !(listObj instanceof List)) { return null; } StringBuilder sb = new StringBuilder(); sb.append(" "); try { for (BackgroundItem item : (List<BackgroundItem>) listObj) { sb.append(item.getName()); sb.append(" "); } } catch (Exception ex) { log.info("Error iterating through the list of background items - most likely because it's null, " + "but not detectable because it's a lazy-loaded collection. ", ex); } return sb.toString(); }
BackgroundItemListStringBridge implements StringBridge { @SuppressWarnings("unchecked") @Override public String objectToString(final Object listObj) { if (listObj == null || !(listObj instanceof List)) { return null; } StringBuilder sb = new StringBuilder(); sb.append(" "); try { for (BackgroundItem item : (List<BackgroundItem>) listObj) { sb.append(item.getName()); sb.append(" "); } } catch (Exception ex) { log.info("Error iterating through the list of background items - most likely because it's null, " + "but not detectable because it's a lazy-loaded collection. ", ex); } return sb.toString(); } }
BackgroundItemListStringBridge implements StringBridge { @SuppressWarnings("unchecked") @Override public String objectToString(final Object listObj) { if (listObj == null || !(listObj instanceof List)) { return null; } StringBuilder sb = new StringBuilder(); sb.append(" "); try { for (BackgroundItem item : (List<BackgroundItem>) listObj) { sb.append(item.getName()); sb.append(" "); } } catch (Exception ex) { log.info("Error iterating through the list of background items - most likely because it's null, " + "but not detectable because it's a lazy-loaded collection. ", ex); } return sb.toString(); }  }
BackgroundItemListStringBridge implements StringBridge { @SuppressWarnings("unchecked") @Override public String objectToString(final Object listObj) { if (listObj == null || !(listObj instanceof List)) { return null; } StringBuilder sb = new StringBuilder(); sb.append(" "); try { for (BackgroundItem item : (List<BackgroundItem>) listObj) { sb.append(item.getName()); sb.append(" "); } } catch (Exception ex) { log.info("Error iterating through the list of background items - most likely because it's null, " + "but not detectable because it's a lazy-loaded collection. ", ex); } return sb.toString(); }  @SuppressWarnings("unchecked") @Override String objectToString(final Object listObj); }
BackgroundItemListStringBridge implements StringBridge { @SuppressWarnings("unchecked") @Override public String objectToString(final Object listObj) { if (listObj == null || !(listObj instanceof List)) { return null; } StringBuilder sb = new StringBuilder(); sb.append(" "); try { for (BackgroundItem item : (List<BackgroundItem>) listObj) { sb.append(item.getName()); sb.append(" "); } } catch (Exception ex) { log.info("Error iterating through the list of background items - most likely because it's null, " + "but not detectable because it's a lazy-loaded collection. ", ex); } return sb.toString(); }  @SuppressWarnings("unchecked") @Override String objectToString(final Object listObj);  }