Expected Behavior

I want to make a list of messages that have different MessageTypes. Making AbstractMessage not abstract or making a class that extends AbstractMessage that has a constructor with a MessageType parameter would help out.

Current Behavior

new AbstractMessage(MessageType.fromValue(messageRecord.Role()), messageRecord.Content()) doesn't work because AbstractMessage is abstract.

new Message(){ ... @Override public List<Media> getMedia(String... dummy) { return List.of(); } ... } doesn't work because getMedia is deprecated and marked for removal.

Context

As I workaround, I need to make a switch statement that would check messageRecord.Role() and return an appropriate class.