@Test public void testObjectToStringWhenNull() { assertNull(sut.objectToString(null)); }
@Override public String objectToString(final Object backgroundObj) { if (backgroundObj == null || !(backgroundObj instanceof Background)) { return null; } StringBuilder sb = new StringBuilder(); try { Background bg = (Background) backgroundObj; sb.append(" "); List<BackgroundItemType> handledTypes = new ArrayList<BackgroundItemType>(); handledTypes.add(BackgroundItemType.SKILL); for (BackgroundItemType itemType : handledTypes) { sb.append(itemBridge.objectToString(bg.getBackgroundItems(itemType))); } 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(); }
BackgroundStringBridge implements StringBridge { @Override public String objectToString(final Object backgroundObj) { if (backgroundObj == null || !(backgroundObj instanceof Background)) { return null; } StringBuilder sb = new StringBuilder(); try { Background bg = (Background) backgroundObj; sb.append(" "); List<BackgroundItemType> handledTypes = new ArrayList<BackgroundItemType>(); handledTypes.add(BackgroundItemType.SKILL); for (BackgroundItemType itemType : handledTypes) { sb.append(itemBridge.objectToString(bg.getBackgroundItems(itemType))); } 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(); } }
BackgroundStringBridge implements StringBridge { @Override public String objectToString(final Object backgroundObj) { if (backgroundObj == null || !(backgroundObj instanceof Background)) { return null; } StringBuilder sb = new StringBuilder(); try { Background bg = (Background) backgroundObj; sb.append(" "); List<BackgroundItemType> handledTypes = new ArrayList<BackgroundItemType>(); handledTypes.add(BackgroundItemType.SKILL); for (BackgroundItemType itemType : handledTypes) { sb.append(itemBridge.objectToString(bg.getBackgroundItems(itemType))); } 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(); }  }
BackgroundStringBridge implements StringBridge { @Override public String objectToString(final Object backgroundObj) { if (backgroundObj == null || !(backgroundObj instanceof Background)) { return null; } StringBuilder sb = new StringBuilder(); try { Background bg = (Background) backgroundObj; sb.append(" "); List<BackgroundItemType> handledTypes = new ArrayList<BackgroundItemType>(); handledTypes.add(BackgroundItemType.SKILL); for (BackgroundItemType itemType : handledTypes) { sb.append(itemBridge.objectToString(bg.getBackgroundItems(itemType))); } 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(); }  @Override String objectToString(final Object backgroundObj); }
BackgroundStringBridge implements StringBridge { @Override public String objectToString(final Object backgroundObj) { if (backgroundObj == null || !(backgroundObj instanceof Background)) { return null; } StringBuilder sb = new StringBuilder(); try { Background bg = (Background) backgroundObj; sb.append(" "); List<BackgroundItemType> handledTypes = new ArrayList<BackgroundItemType>(); handledTypes.add(BackgroundItemType.SKILL); for (BackgroundItemType itemType : handledTypes) { sb.append(itemBridge.objectToString(bg.getBackgroundItems(itemType))); } 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(); }  @Override String objectToString(final Object backgroundObj);  }