class TemporalUnitOffset implements TemporalOffset<Temporal> {

  protected final TemporalUnit unit;
  protected final long value;

  /**
   * Creates a new temporal offset for a given temporal unit.
   * @param value the value of the offset.
   * @param unit temporal unit of the offset.
   * @throws NullPointerException if the given unit is {@code null}.
   * @throws IllegalArgumentException if the given value is negative.
   */
  public TemporalUnitOffset(long value, TemporalUnit unit) {
    requireNonNull(unit);
    checkThatValueIsPositive(value);
    this.value = value;
    this.unit = unit;
  }

  private static void checkThatValueIsPositive(long value) {
    checkArgument(value >= 0, "The value of the offset should be greater than zero");
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String getBeyondOffsetDifferenceDescription(Temporal temporal1, Temporal temporal2) {
    try {
      return format("%s %s but difference was %s %s", value, unit, getDifference(temporal1, temporal2), unit);
    } catch (@SuppressWarnings("unused") ArithmeticException e) {
      return format("%s %s but difference was %s", value, unit, getAbsoluteDuration(temporal1, temporal2));
    }
  }

  /**
   * Returns absolute value of the difference according to time unit.
   *
   * @param temporal1 the first {@link Temporal}
   * @param temporal2 the second {@link Temporal}
   * @return absolute value of the difference according to time unit.
   */
  protected long getDifference(Temporal temporal1, Temporal temporal2) {
    return abs(unit.between(temporal1, temporal2));
  }

  /**
   * Returns absolute value of the difference as Duration.
   *
   * @param temporal1 the first {@link Temporal}
   * @param temporal2 the second {@link Temporal}
   * @return absolute value of the difference as Duration.
   */
  protected Duration getAbsoluteDuration(Temporal temporal1, Temporal temporal2) {
    return Duration.between(temporal1, temporal2).abs();
  }

  public TemporalUnit getUnit() {
    return unit;
  }

  @Override
  public int hashCode() {
    return Objects.hash(value);
  }

  @Override
  public boolean equals(Object obj) {<FILL_FUNCTION_BODY>}

}

    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    TemporalUnitOffset other = (TemporalUnitOffset) obj;
    return value == other.value;
  
<no_super_class>