@Contract(pure=true)
  public static int getLastElement(int @Nullable [] array, int defaultValue) {
    return array == null || array.length == 0 ? defaultValue : array[array.length - 1];
  }
@Contract(pure=true)
  public static int getLastElement(int @Nullable [] array, int defaultValue)