Topic { @Override public String toString() { return topic; } private  Topic(String topic, List<Level> levels); static Topic parse(String topic); List<Level> getLevels(); List<Level> getLabels(); boolean hasLabel(String label); boolean conflictsWith(Topic other); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void labelsPrintWithBraces() { Topic.Level level = new Topic.Level("foo", true); assertTrue(level.isLabel()); assertThat(level.toString(), equalTo("{foo}")); }
@Test public void nonLabelsPrintWithoutBraces() { Topic.Level level = new Topic.Level("foo"); assertFalse(level.isLabel()); assertThat(level.toString(), equalTo("foo")); }