class Warning implements Serializable, Comparable<Warning> {

  @Override
  public int compareTo(Warning o) {
    return Comparator.comparing(Warning::getText)
        .thenComparing(Warning::getTag, Comparator.nullsFirst(String::compareTo))
        .compare(this, o);
  }

  public  Warning(String text, @Nullable String tag);

}