DefaultNodePresentationProperties implements NodePresentationProperties { @Override public String getNodeText(String nodeId) { if (properties.isRequirementNode(nodeId)) { return textForRequirementNode(nodeId); } Charm charm = findNonNullCharm(toCharmName(nodeId)); String name = getNodeName(charm); if (isTreeRoot(charm)) { return name.toUpperCase(); } return name; } DefaultNodePresentationProperties(Resources resources, FunctionalNodeProperties properties, CharmMap map); @Override String getNodeText(String nodeId);  }
@Test public void translatesMultipleCharmsOfACertainTraitWithEssenceRequirement() throws Exception { String id = "Requirement.Socialize.Essence3.4"; FunctionalNodeProperties requirementProperties = new DefaultFunctionalNodeProperties(); DummyResources resources = new DummyResources(); resources.putString("Requirement.Message", "{0,number,integer} {1}{2} {3}"); resources.putString("Requirement.Socialize", "Socialize"); resources.putString("Essence", "Essence"); resources.putString("Charms.Charm.Multiple", "Charms"); CharmMap map = null; DefaultNodePresentationProperties properties = new DefaultNodePresentationProperties(resources, requirementProperties, map); String nodeText = properties.getNodeText(id); assertThat(nodeText, is("4 Essence 3+ Socialize Charms")); }