### Question:
LoadingStatusIndicatorUpdater implements Consumer<PdfDescriptorLoadingStatus> { @Override public void accept(PdfDescriptorLoadingStatus t) { FontAwesomeIcon icon = Optional.ofNullable(t).map(PdfDescriptorLoadingStatus::getIcon).orElse(null); if (nonNull(icon)) { FontAwesomeIconFactory.get().setIcon(indicator, icon, ContentDisplay.CENTER); } else { indicator.setGraphic(null); } Arrays.stream(PdfDescriptorLoadingStatus.values()).map(PdfDescriptorLoadingStatus::getStyle) .filter(StringUtils::isNotEmpty).forEach(indicator.getStyleClass()::remove); if (nonNull(t) && isNotBlank(t.getStyle())) { indicator.getStyleClass().add(t.getStyle()); } if (nonNull(t) && isNotBlank(t.getDescription())) { indicator.setTooltip(new Tooltip(t.getDescription())); } else { indicator.setTooltip(null); } } LoadingStatusIndicatorUpdater(Labeled indicator); @Override void accept(PdfDescriptorLoadingStatus t);  }### Answer:
@Test public void textAndTooltipAndStyle() { victim.accept(PdfDescriptorLoadingStatus.ENCRYPTED); assertEquals(PdfDescriptorLoadingStatus.ENCRYPTED.getIcon().unicode(), ((Text) labeled.getGraphic()).getText()); assertTrue(labeled.getStyleClass().contains(PdfDescriptorLoadingStatus.ENCRYPTED.getStyle())); assertNotNull(labeled.getTooltip()); }
@Test public void styleIsRemoved() { victim.accept(PdfDescriptorLoadingStatus.ENCRYPTED); assertTrue(labeled.getStyleClass().contains(PdfDescriptorLoadingStatus.ENCRYPTED.getStyle())); victim.accept(PdfDescriptorLoadingStatus.REQUESTED); assertFalse(labeled.getStyleClass().contains(PdfDescriptorLoadingStatus.ENCRYPTED.getStyle())); }
@Test public void textAndNoTooltip() { victim.accept(PdfDescriptorLoadingStatus.LOADING); assertEquals(PdfDescriptorLoadingStatus.LOADING.getIcon().unicode(), ((Text) labeled.getGraphic()).getText()); assertNull(labeled.getTooltip()); }
@Test public void nullSafe() { victim.accept(null); assertEquals("", labeled.getText()); assertNull(labeled.getTooltip()); }
@Test public void nullState() { victim.accept(null); assertNull(labeled.getGraphic()); }
@Test public void nullIcon() { victim.accept(PdfDescriptorLoadingStatus.INITIAL); assertNull(labeled.getGraphic()); }
@Test public void notNullIcon() { victim.accept(PdfDescriptorLoadingStatus.REQUESTED); assertNotNull(labeled.getGraphic()); }