StyleFactory { public AttributedString evaluate(final String expression) { requireNonNull(expression); return new StyleExpression(resolver).evaluate(expression); } StyleFactory(final StyleResolver resolver); AttributedString style(final String style, final String value); AttributedString style(final String style, final String format, final Object... params); AttributedString evaluate(final String expression); AttributedString evaluate(final String format, final Object... params);  }
@Test public void evaluateExpression() { AttributedString string = underTest.evaluate("@{bold foo}"); System.out.println(string.toAnsi()); assert string.equals(new AttributedString("foo", BOLD)); }
@Test public void evaluateExpressionWithFormat() { AttributedString string = underTest.evaluate("@{bold %s}", "foo"); System.out.println(string.toAnsi()); assert string.equals(new AttributedString("foo", BOLD)); }