### Question:
ColoredNodeDecoration extends NodeDecorationBase { @Override public boolean apply(ProjectViewNode node, PresentationData data) { setName(data); String locationString = data.getLocationString(); if (ui.hasLocationPart()) { if (ui.isLocationPartLast() && locationString != null) { String location = ui.getDecorationPartText(locationString, DecorationPartType.LOCATION); if (location != null) { data.setLocationString(" " + location); } } } else { if (locationString != null) { data.setTooltip(locationString); } data.setLocationString(""); } boolean first = true; Collection<DecorationPartType> types = ui.getDecorationTypes(); for (DecorationPartType type : types) { if (type == DecorationPartType.LOCATION && !ui.isLocationPartLast()) { if (locationString != null) { String location = " " + coloredUi.getDecorationPartText(locationString, type); data.addText(getSpacer(first)); data.addText(new ColoredFragment(location, coloredUi.getLocationAttributes())); data.setLocationString(""); first = false; } } else { ColoredFragment fragment = getFragmentFor(type); if (fragment != null) { data.addText(getSpacer(first)); data.addText(fragment); first = false; } } } return false; } ColoredNodeDecoration(@NotNull ColoredNodeDecorationUi ui,
                               @NotNull GitRepository repo,
                               @NotNull RepoInfo repoInfo,
                               @NotNull ExtendedRepoInfo extendedRepoInfo); @Override boolean apply(ProjectViewNode node, PresentationData data);  }### Answer:
@Test @DisplayName("Includes name if colored text is empty but presentable text is present") void nameIsIncludedIfPresentableTextIsPresentAndColoredTextIsEmpty() { PresentationData data = presentationData(false); final String itemName = "item_name"; data.setPresentableText(itemName); PresentationData presentationData = apply(data); DecorationData decorationData = getDecorationData(presentationData); assertThat(decorationData.text).startsWith(itemName); }