EntityIdSerializer extends JsonSerializer<EntityId> { @Override public void serialize(EntityId value, JsonGenerator gen, SerializerProvider serializers) throws IOException { if (value != null) { gen.writeNumber(value.getId()); } }  @Override void serialize(EntityId value, JsonGenerator gen, SerializerProvider serializers);  }
@Test void testNull() throws Exception { new EntityIdSerializer().serialize(null, jsonGenerator, null); verifyNoInteractions(jsonGenerator); }
@Test void testEntity() throws Exception { var entity = EntityId.of(10L, 20L, 30L, EntityTypeEnum.ACCOUNT); new EntityIdSerializer().serialize(entity, jsonGenerator, null); verify(jsonGenerator).writeNumber(entity.getId()); }