TagElementView implements Transform<TagElement, String>,
        HasNameView<TagElement>, 
        HasElementsView<TagElement>, 
        HasAttributesView<TagElement> { @Override public Optional<String> transform(Generator gen, TagElement model) { return Optional.of("<" + transformName(model) + transformAttributes(gen, model) + (model.elements().isEmpty() ? '/' : "") + '>' + transformElements(gen, model) + (model.elements().isEmpty() ? "" : new StringBuilder() .append("</") .append(transformName(model)) .append('>')) ); }  @Override Optional<String> transform(Generator gen, TagElement model);  }
@Test void transform() { final Generator generator = Generator.forJava(); final TagElementView tagElementView = new TagElementView(); final TagElement tagElement = TagElement.of("element"); assertTrue(tagElementView.transform(generator, tagElement).isPresent()); }