I have a generic class which represents a fragment of text. That fragment of text may have any of a number of different modes (different types of highlighting). Those mode
You need to introduce a new type that accounts for the bound of Enum
public class TextFragment, E extends TextFragmentMode> {