StaticButtonBuilder implements Serializable { @Override public String toString() { if (url == null) { throw new IllegalStateException("thing url is required, but missing"); } StringBuilder sb = new StringBuilder(); sb.append("<a"); if (styleClass != null) { sb.append(" class=\"").append(escape(styleClass)).append('"'); } if (style != null) { sb.append(" style=\"").append(escape(style)).append('"'); } sb.append(" href=\"").append(escape(url)).append('"'); for (Map.Entry<String, String> entry : attributes.entrySet()) { sb.append(' ').append(entry.getKey()).append("=\""); sb.append(escape(entry.getValue())); sb.append('"'); } sb.append('>'); if (badgeUrl != null) { sb.append("<img src=\"").append(escape(badgeUrl)).append('"') .append(" alt=\"Flattr this\"") .append(" title=\"Flattr this\"") .append(" border=\"0\"") .append(" />"); } else { BadgeType useType = (type != null ? type : BadgeType.DEFAULT); sb.append("<img src=\"").append(useType.getUrl()).append('"') .append(" width=\"").append(useType.getWidth()).append('"') .append(" height=\"").append(useType.getHeight()).append('"') .append(" alt=\"Flattr this\"") .append(" title=\"Flattr this\"") .append(" border=\"0\"") .append(" />"); } sb.append("</a>"); return sb.toString(); }  StaticButtonBuilder thing(String url); StaticButtonBuilder thing(AutoSubmission submission); StaticButtonBuilder thing(Thing thing); StaticButtonBuilder badge(BadgeType type); StaticButtonBuilder badgeUrl(String url); StaticButtonBuilder badgeUrl(URL url); StaticButtonBuilder style(String style); StaticButtonBuilder styleClass(String styleClass); StaticButtonBuilder attribute(String attribute, String value); @Override String toString();  }
@Test(expected = IllegalStateException.class) public void testNoArgBuilder() { StaticButtonBuilder builder = new StaticButtonBuilder(); builder.toString(); }