### Question:
AvroConverter { public Event<?, ?> toModel(AvroKey avroKey, AvroValue avroValue) { if (avroKey.getKey() instanceof AvroSpecificationKey) { Object specification = null; if (avroValue != null) { specification = avroValue.getValue(); } return toModel((AvroSpecificationKey) avroKey.getKey(), specification); } else if (avroKey.getKey() instanceof AvroStatusKey) { AvroStatus avroStatus = null; if (avroValue != null) { avroStatus = (AvroStatus) avroValue.getValue(); } return toModel((AvroStatusKey) avroKey.getKey(), avroStatus); } else { throw new IllegalArgumentException("Unknown key " + avroKey); } }  Event<?, ?> toModel(AvroKey avroKey, AvroValue avroValue); AvroEvent toAvro(Event<?, ?> event);  }### Answer:
@Test public void specificationToModel() { var result = underTest.toModel(avroSpecificationEvent.getKey(), avroSpecificationEvent.getValue()); assertThat(result, is(Event.specification(domainKey, specification))); }
@Test public void specificationDeleteToModel() { var result = underTest.toModel(new AvroKey(avroSpecificationKey), null); assertThat(result, is(Event.specificationDeletion(domainKey))); }
@Test public void statusToModel() { var result = underTest.toModel(new AvroKey(avroStatusKey), new AvroValue(avroStatus)); assertThat(result, is(Event.status(domainKey, statusEntry))); }
@Test public void statusDeleteToModel() { var result = underTest.toModel(new AvroKey(avroStatusKey), null); assertThat(result, is(Event.statusDeletion(domainKey, "statusName"))); }
@Test public void streamSpecificationToModel() { var result = underTest.toModel(avroStreamSpecificationEvent.getKey(), avroStreamSpecificationEvent.getValue()); assertThat(result, is(Event.specification(streamKey, streamSpecification))); }