@Test(dataProvider = "getMetricsItems")
public void testWriteHeaders(Set<MetricsItem> items, Set<String> expected) {

  BasicMetricsCollector collector = new BasicMetricsCollector(config, topology, items);
  PrintWriter writer = mock(PrintWriter.class);
  collector.writeHeader(writer);
  verify(writer, times(1)).println(anyString());
  verify(writer, times(1)).flush();
  for (String h : expected) {
    collector.header.contains(h);
  }
}