private static @Nullable <T> T getFirst(final T @Nullable [] array) {
    return array == null || array.length == 0 ? null : array[0];
  }
private static @Nullable <T> T getFirst(final T @Nullable [] array)