What can replace instanceof for java 11?
@Override public int compareTo(@NotNull Object o) { if (o instanceof Task task) { if (task.getStartTime() == null) { return -1; } else if (task.getStartTime().isBefore(this.startTime)) { return 1; } else if (task.getStartTime().isAfter(this.startTime)) { return -1; } else return 0; } else throw new RuntimeException("Не наследник Task"); } java: pattern matching in instanceof is not supported in… Read More What can replace instanceof for java 11?