class PackedLocalTime {

  public static int withMinute(int minute, int packedTime) {
    if (PackedLocalTime.getMinute(packedTime) == minute) {
      return packedTime;
    }
    ChronoField.MINUTE_OF_HOUR.checkValidValue(minute);
    return create(
        PackedLocalTime.getHour(packedTime),
        minute,
        PackedLocalTime.getSecond(packedTime),
        PackedLocalTime.getMilliseconds(packedTime));
  }

}