@Test
@SuppressWarnings("unchecked")
public void testEitherWatermarkExtractor() {

	try {
		new DummyFlinkKafkaConsumer<String>().assignTimestampsAndWatermarks((AssignerWithPeriodicWatermarks<String>) null);
		fail();
	} catch (NullPointerException ignored) {}
	try {
		new DummyFlinkKafkaConsumer<String>().assignTimestampsAndWatermarks((AssignerWithPunctuatedWatermarks<String>) null);
		fail();
	} catch (NullPointerException ignored) {}
	final AssignerWithPeriodicWatermarks<String> periodicAssigner = mock(AssignerWithPeriodicWatermarks.class);
	final AssignerWithPunctuatedWatermarks<String> punctuatedAssigner = mock(AssignerWithPunctuatedWatermarks.class);
	DummyFlinkKafkaConsumer<String> c1 = new DummyFlinkKafkaConsumer<>();
	c1.assignTimestampsAndWatermarks(periodicAssigner);
	try {
		c1.assignTimestampsAndWatermarks(punctuatedAssigner);
		fail();
	} catch (IllegalStateException ignored) {}
	DummyFlinkKafkaConsumer<String> c2 = new DummyFlinkKafkaConsumer<>();
	c2.assignTimestampsAndWatermarks(punctuatedAssigner);
	try {
		c2.assignTimestampsAndWatermarks(periodicAssigner);
		fail();
	} catch (IllegalStateException ignored) {}
}