package com.faforever.client.remote.domain;

import org.jetbrains.annotations.NotNull;

public class RatingRange implements Comparable<RatingRange> {

  private final Integer min;
  private final Integer max;

  public RatingRange(Integer min, Integer max) {
    this.min = min;
    this.max = max;
  }

  @Override
  public int compareTo(@NotNull RatingRange o) {
    Integer otherMin = o.getMin();

    if (min == null) {
      return otherMin == null ? 0 : otherMin;
    }

    return Integer.compare(min, o.getMin());
  }

  public Integer getMin() {
    return min;
  }

  public Integer getMax() {
    return max;
  }
}

@@ -453,24 +453,69 @@
 l ? 0 : 
-otherMin
+-1;%0A    %7D%0A%0A    if (otherMin == null) %7B%0A      return 1
 ;%0A    %7D%0A
@@ -548,25 +548,23 @@
 e(min, o
-.get
+ther
 Min
-()
 );%0A  %7D%0A%0A

Fix RatingRange comparator for null values (#2150)