class FloatComparator extends NullSafeComparator<Float> {

  private float precision;

  public FloatComparator(float epsilon) {
    this.precision = epsilon;
  }

  public float getEpsilon() {
    return precision;
  }

  @Override
  public int compareNonNull(Float x, Float y) {
    if (closeEnough(x, y, precision)) return 0;
    return x < y ? -1 : 1;
  }

  private boolean closeEnough(Float x, Float y, float epsilon) {<FILL_FUNCTION_BODY>}

  @Override
  public int hashCode() {
    return 31 + Float.floatToIntBits(precision);
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (!(obj instanceof FloatComparator)) return false;
    FloatComparator other = (FloatComparator) obj;
    return Float.floatToIntBits(precision) == Float.floatToIntBits(other.precision);
  }

  @Override
  public String toString() {
    return format("FloatComparator[precision=%s]", precision);
  }
}

    return x.floatValue() == y.floatValue() || Math.abs(x - y) <= epsilon;
  
<methods>public int compare(java.lang.Float, java.lang.Float) <variables>