@Test
@SuppressWarnings({"unchecked", "unsafe"})

public void testAddListener() throws Exception {
  final DangerousConsumer<BuildSummary> listener = mock(DangerousConsumer.class);
  buildService.addListener(listener);
  buildService.save(new BuildDetails());
  verify(listener).accept(any(BuildSummary.class));
}