AttributeView implements Transform<Attribute, String>, 
        HasNameView<Attribute>, HasValueView<Attribute> { @Override public Optional<String> transform(Generator gen, Attribute model) { return Optional.of(transformName(model) + (model.isEscape() ? transformValue(model) : model.getValue() ).map(s -> "=\"" + s + "\"").orElse("") ); }  @Override Optional<String> transform(Generator gen, Attribute model);  }
@Test void transform() { final Generator generator = Generator.forJava(); final AttributeView attributeView = new AttributeView(); final Attribute attribute = Attribute.of("attribute"); assertTrue(attributeView.transform(generator, attribute).isPresent()); attribute.setEscape(false); assertTrue(attributeView.transform(generator, attribute).isPresent()); }