de.caff.generics.tuple

## Class Tuples

- java.lang.Object
- - de.caff.generics.tuple.Tuples

-     public final class Tuples
      extends java.lang.Object

  Tuple creation and type casting.

  The tuple factory methods `T(...)` (create tuple with non-null elements) and `N(...)` (create tuple with nullable elements) are best imported statically. This allows short on-the-fly tuple creation like

        return T(a, b, c); // returns a 3-tuple (a, b, c)

  instead of more gabby constructor calls.

  Furthermore, there are `cast()` methods which address the problem that Java is overly picky with tuple types because it does not understand that tuples use their types read-only.

  Assume you have two tuples and want to add then to a more generic collection:

       Tuple2<Rectangle2D, Color> coloredRect = T(new Rectangle(), Color.red);
       Tuple2<Ellipse2D, Color> coloredCircle = T(new Ellipse2D.Double(), Color.green);
       Collection<Tuple2<Shape, Color>> coloredShapes = new LinkedList<>();
       coloredShapes.add(coloredRect);   // error: incompatible types: de.caff.generics.tuple.Tuple2<java.awt.geom.Rectangle2D,java.awt.Color> cannot be converted to de.caff.generics.tuple.Tuple2<java.awt.Shape,java.awt.Color>
       coloredShapes.add(coloredCircle); // error: incompatible types: de.caff.generics.tuple.Tuple2<java.awt.geom.Ellipse2D,java.awt.Color> cannot be converted to de.caff.generics.tuple.Tuple2<java.awt.Shape,java.awt.Color>

  Although both `Rectangle` and `Ellipse2D` implement `Shape` compiling the above will result in the two compiler errors mentioned in the comments. The reason is that the compiler cannot know that it is not possible to set something in a tuple (indeed it could know right now, but cannot know what changes might happen in the future). If it would accept the code for a mutable tuple, somebody could take the `coloredShapes`, extract the collection's first tuple, and set its first element to a circle. But the first tuple is the same as `coloredRect`, which is convinced that its first element is a rectangle. Ouch!

  So there is a good reason for Java to be careful, but in this case it is not necessary, as the tuples here are deliberately designed immutable. So to circumvent the problem use the following code instead of the last 2 lines of above example which will make it compile without even a warning (assumes static import of `cast`):

       coloredShapes.add(cast(coloredRect));
       coloredShapes.add(cast(coloredCircle));

  All `cast()` methods in this class will just directly return their tuple argument as is. The JIT should even be able to remove these calls,

  Since:
    December 07, 2021
  Author:
    Rammi
  See Also:
    `Tuple`

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T1,T2> ITuple2<T1,T2>` | `downCast(ITuple2<? extends T1,? extends T2> tuple)` Allow to view a 2-tuple as one with different more basic element types.
    `static <T1,T2,T3> ITuple3<T1,T2,T3>` | `downCast(ITuple3<? extends T1,? extends T2,? extends T3> tuple)` Allow to view a 3-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4> ITuple4<T1,T2,T3,T4>` | `downCast(ITuple4<? extends T1,? extends T2,? extends T3,? extends T4> tuple)` Allow to view a 4-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5> ITuple5<T1,T2,T3,T4,T5>` | `downCast(ITuple5<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5> tuple)` Allow to view a 5-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6> ITuple6<T1,T2,T3,T4,T5,T6>` | `downCast(ITuple6<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6> tuple)` Allow to view a 6-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7> ITuple7<T1,T2,T3,T4,T5,T6,T7>` | `downCast(ITuple7<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7> tuple)` Allow to view a 7-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> ITuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `downCast(ITuple8<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8> tuple)` Allow to view an 8-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> ITuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `downCast(ITuple9<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8,? extends T9> tuple)` Allow to view a 9-tuple as one with different more basic element types.
    `static <T1,T2> NTuple2<T1,T2>` | `downCast(NTuple2<? extends T1,? extends T2> tuple)` Allow to view a 2-tuple as one with different more basic element types.
    `static <T1,T2,T3> NTuple3<T1,T2,T3>` | `downCast(NTuple3<? extends T1,? extends T2,? extends T3> tuple)` Allow to view a 3-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4> NTuple4<T1,T2,T3,T4>` | `downCast(NTuple4<? extends T1,? extends T2,? extends T3,? extends T4> tuple)` Allow to view a 4-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5> NTuple5<T1,T2,T3,T4,T5>` | `downCast(NTuple5<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5> tuple)` Allow to view a 5-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6> NTuple6<T1,T2,T3,T4,T5,T6>` | `downCast(NTuple6<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6> tuple)` Allow to view a 6-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7> NTuple7<T1,T2,T3,T4,T5,T6,T7>` | `downCast(NTuple7<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7> tuple)` Allow to view a 7-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> NTuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `downCast(NTuple8<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8> tuple)` Allow to view an 8-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> NTuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `downCast(NTuple9<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8,? extends T9> tuple)` Allow to view a 9-tuple as one with different more basic element types.
    `static <T1,T2> Tuple2<T1,T2>` | `downCast(Tuple2<? extends T1,? extends T2> tuple)` Allow to view a 2-tuple as one with different more basic element types.
    `static <T1,T2,T3> Tuple3<T1,T2,T3>` | `downCast(Tuple3<? extends T1,? extends T2,? extends T3> tuple)` Allow to view a 3-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4>` | `downCast(Tuple4<? extends T1,? extends T2,? extends T3,? extends T4> tuple)` Allow to view a 4-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5>` | `downCast(Tuple5<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5> tuple)` Allow to view a 5-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6>` | `downCast(Tuple6<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6> tuple)` Allow to view a 6-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7>` | `downCast(Tuple7<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7> tuple)` Allow to view a 7-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `downCast(Tuple8<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8> tuple)` Allow to view an 8-tuple as one with different more basic element types.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `downCast(Tuple9<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8,? extends T9> tuple)` Allow to view a 9-tuple as one with different more basic element types.
    `static <T1,T2> NTuple2<T1,T2>` | `N(T1 e1, T2 e2)` Create a 2-tuple with nullable elements.
    `static <T1,T2,T3> NTuple3<T1,T2,T3>` | `N(T1 e1, T2 e2, T3 e3)` Create a 3-tuple with nullable elements.
    `static <T1,T2,T3,T4> NTuple4<T1,T2,T3,T4>` | `N(T1 e1, T2 e2, T3 e3, T4 e4)` Create a 4-tuple with nullable elements.
    `static <T1,T2,T3,T4,T5> NTuple5<T1,T2,T3,T4,T5>` | `N(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5)` Create a 5-tuple with nullable elements.
    `static <T1,T2,T3,T4,T5,T6> NTuple6<T1,T2,T3,T4,T5,T6>` | `N(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6)` Create a 6-tuple with nullable elements.
    `static <T1,T2,T3,T4,T5,T6,T7> NTuple7<T1,T2,T3,T4,T5,T6,T7>` | `N(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7)` Create a 7-tuple with nullable elements.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> NTuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `N(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7, T8 e8)` Create an 8-tuple with nullable elements.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> NTuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `N(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7, T8 e8, T9 e9)` Create a 9-tuple with nullable elements.
    `static <T1,T2> Tuple2<T1,T2>` | `T(T1 e1, T2 e2)` Create a 2-tuple with non-null elements.
    `static <T1,T2,T3> Tuple3<T1,T2,T3>` | `T(T1 e1, T2 e2, T3 e3)` Create a 3-tuple with non-null elements.
    `static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4>` | `T(T1 e1, T2 e2, T3 e3, T4 e4)` Create a 4-tuple with non-null elements.
    `static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5>` | `T(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5)` Create a 5-tuple with non-null elements.
    `static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6>` | `T(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6)` Create a 6-tuple with non-null elements.
    `static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7>` | `T(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7)` Create a 7-tuple with non-null elements.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `T(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7, T8 e8)` Create an 8-tuple with non-null elements.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `T(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7, T8 e8, T9 e9)` Create a 9-tuple with non-null elements.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### T

          @NotNull
          public static <T1,T2> Tuple2<T1,T2> T(@NotNull
                                                         T1 e1,
                                                         @NotNull
                                                         T2 e2)

      Create a 2-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
      Returns:
        2-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3> Tuple3<T1,T2,T3> T(@NotNull
                                                               T1 e1,
                                                               @NotNull
                                                               T2 e2,
                                                               @NotNull
                                                               T3 e3)

      Create a 3-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
      Returns:
        3-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4> T(@NotNull
                                                                     T1 e1,
                                                                     @NotNull
                                                                     T2 e2,
                                                                     @NotNull
                                                                     T3 e3,
                                                                     @NotNull
                                                                     T4 e4)

      Create a 4-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
      Returns:
        4-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5> T(@NotNull
                                                                           T1 e1,
                                                                           @NotNull
                                                                           T2 e2,
                                                                           @NotNull
                                                                           T3 e3,
                                                                           @NotNull
                                                                           T4 e4,
                                                                           @NotNull
                                                                           T5 e5)

      Create a 5-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
      Returns:
        5-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6> T(@NotNull
                                                                                 T1 e1,
                                                                                 @NotNull
                                                                                 T2 e2,
                                                                                 @NotNull
                                                                                 T3 e3,
                                                                                 @NotNull
                                                                                 T4 e4,
                                                                                 @NotNull
                                                                                 T5 e5,
                                                                                 @NotNull
                                                                                 T6 e6)

      Create a 6-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
      Returns:
        6-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7> T(@NotNull
                                                                                       T1 e1,
                                                                                       @NotNull
                                                                                       T2 e2,
                                                                                       @NotNull
                                                                                       T3 e3,
                                                                                       @NotNull
                                                                                       T4 e4,
                                                                                       @NotNull
                                                                                       T5 e5,
                                                                                       @NotNull
                                                                                       T6 e6,
                                                                                       @NotNull
                                                                                       T7 e7)

      Create a 7-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
        `T7` - seventh element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
        `e7` - seventh tuple element
      Returns:
        7-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> T(@NotNull
                                                                                             T1 e1,
                                                                                             @NotNull
                                                                                             T2 e2,
                                                                                             @NotNull
                                                                                             T3 e3,
                                                                                             @NotNull
                                                                                             T4 e4,
                                                                                             @NotNull
                                                                                             T5 e5,
                                                                                             @NotNull
                                                                                             T6 e6,
                                                                                             @NotNull
                                                                                             T7 e7,
                                                                                             @NotNull
                                                                                             T8 e8)

      Create an 8-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
        `T7` - seventh element type
        `T8` - eighth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
        `e7` - seventh tuple element
        `e8` - eighth tuple element
      Returns:
        8-tuple with the given elements

    - #### T

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> T(@NotNull
                                                                                                   T1 e1,
                                                                                                   @NotNull
                                                                                                   T2 e2,
                                                                                                   @NotNull
                                                                                                   T3 e3,
                                                                                                   @NotNull
                                                                                                   T4 e4,
                                                                                                   @NotNull
                                                                                                   T5 e5,
                                                                                                   @NotNull
                                                                                                   T6 e6,
                                                                                                   @NotNull
                                                                                                   T7 e7,
                                                                                                   @NotNull
                                                                                                   T8 e8,
                                                                                                   @NotNull
                                                                                                   T9 e9)

      Create a 9-tuple with non-null elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
        `T7` - seventh element type
        `T8` - eighth element type
        `T9` - ninth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
        `e7` - seventh tuple element
        `e8` - eighth tuple element
        `e9` - ninth tuple element
      Returns:
        9-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2> NTuple2<T1,T2> N(@Nullable
                                                          T1 e1,
                                                          @Nullable
                                                          T2 e2)

      Create a 2-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
      Returns:
        2-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3> NTuple3<T1,T2,T3> N(@Nullable
                                                                T1 e1,
                                                                @Nullable
                                                                T2 e2,
                                                                @Nullable
                                                                T3 e3)

      Create a 3-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
      Returns:
        3-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3,T4> NTuple4<T1,T2,T3,T4> N(@Nullable
                                                                      T1 e1,
                                                                      @Nullable
                                                                      T2 e2,
                                                                      @Nullable
                                                                      T3 e3,
                                                                      @Nullable
                                                                      T4 e4)

      Create a 4-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
      Returns:
        4-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3,T4,T5> NTuple5<T1,T2,T3,T4,T5> N(@Nullable
                                                                            T1 e1,
                                                                            @Nullable
                                                                            T2 e2,
                                                                            @Nullable
                                                                            T3 e3,
                                                                            @Nullable
                                                                            T4 e4,
                                                                            @Nullable
                                                                            T5 e5)

      Create a 5-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
      Returns:
        5-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> NTuple6<T1,T2,T3,T4,T5,T6> N(@Nullable
                                                                                  T1 e1,
                                                                                  @Nullable
                                                                                  T2 e2,
                                                                                  @Nullable
                                                                                  T3 e3,
                                                                                  @Nullable
                                                                                  T4 e4,
                                                                                  @Nullable
                                                                                  T5 e5,
                                                                                  @Nullable
                                                                                  T6 e6)

      Create a 6-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
      Returns:
        6-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> NTuple7<T1,T2,T3,T4,T5,T6,T7> N(@Nullable
                                                                                        T1 e1,
                                                                                        @Nullable
                                                                                        T2 e2,
                                                                                        @Nullable
                                                                                        T3 e3,
                                                                                        @Nullable
                                                                                        T4 e4,
                                                                                        @Nullable
                                                                                        T5 e5,
                                                                                        @Nullable
                                                                                        T6 e6,
                                                                                        @Nullable
                                                                                        T7 e7)

      Create a 7-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
        `T7` - seventh element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
        `e7` - seventh tuple element
      Returns:
        7-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> NTuple8<T1,T2,T3,T4,T5,T6,T7,T8> N(@Nullable
                                                                                              T1 e1,
                                                                                              @Nullable
                                                                                              T2 e2,
                                                                                              @Nullable
                                                                                              T3 e3,
                                                                                              @Nullable
                                                                                              T4 e4,
                                                                                              @Nullable
                                                                                              T5 e5,
                                                                                              @Nullable
                                                                                              T6 e6,
                                                                                              @Nullable
                                                                                              T7 e7,
                                                                                              @Nullable
                                                                                              T8 e8)

      Create an 8-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
        `T7` - seventh element type
        `T8` - eighth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
        `e7` - seventh tuple element
        `e8` - eighth tuple element
      Returns:
        8-tuple with the given elements

    - #### N

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> NTuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> N(@Nullable
                                                                                                    T1 e1,
                                                                                                    @Nullable
                                                                                                    T2 e2,
                                                                                                    @Nullable
                                                                                                    T3 e3,
                                                                                                    @Nullable
                                                                                                    T4 e4,
                                                                                                    @Nullable
                                                                                                    T5 e5,
                                                                                                    @Nullable
                                                                                                    T6 e6,
                                                                                                    @Nullable
                                                                                                    T7 e7,
                                                                                                    @Nullable
                                                                                                    T8 e8,
                                                                                                    @Nullable
                                                                                                    T9 e9)

      Create a 9-tuple with nullable elements.
      Type Parameters:
        `T1` - first element type
        `T2` - second element type
        `T3` - third element type
        `T4` - fourth element type
        `T5` - fifth element type
        `T6` - sixth element type
        `T7` - seventh element type
        `T8` - eighth element type
        `T9` - ninth element type
      Parameters:
        `e1` - first tuple element
        `e2` - second tuple element
        `e3` - third tuple element
        `e4` - fourth tuple element
        `e5` - fifth tuple element
        `e6` - sixth tuple element
        `e7` - seventh tuple element
        `e8` - eighth tuple element
        `e9` - ninth tuple element
      Returns:
        9-tuple with the given elements

    - #### downCast

          @NotNull
          public static <T1,T2> Tuple2<T1,T2> downCast(@NotNull
                                                                Tuple2<? extends T1,? extends T2> tuple)

      Allow to view a 2-tuple as one with different more basic element types. This will not copy the tuple, this method is mostly useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required last element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3> Tuple3<T1,T2,T3> downCast(@NotNull
                                                                      Tuple3<? extends T1,? extends T2,? extends T3> tuple)

      Allow to view a 3-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4> downCast(@NotNull
                                                                            Tuple4<? extends T1,? extends T2,? extends T3,? extends T4> tuple)

      Allow to view a 4-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5> downCast(@NotNull
                                                                                  Tuple5<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5> tuple)

      Allow to view a 5-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6> downCast(@NotNull
                                                                                        Tuple6<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6> tuple)

      Allow to view a 6-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7> downCast(@NotNull
                                                                                              Tuple7<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7> tuple)

      Allow to view a 7-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> downCast(@NotNull
                                                                                                    Tuple8<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8> tuple)

      Allow to view an 8-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
        `T8` - required eighth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> downCast(@NotNull
                                                                                                          Tuple9<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8,? extends T9> tuple)

      Allow to view a 9-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
        `T8` - required eighth element type
        `T9` - required ninth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2> NTuple2<T1,T2> downCast(@NotNull
                                                                 NTuple2<? extends T1,? extends T2> tuple)

      Allow to view a 2-tuple as one with different more basic element types. This will not copy the tuple, this method is mostly useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required last element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3> NTuple3<T1,T2,T3> downCast(@NotNull
                                                                       NTuple3<? extends T1,? extends T2,? extends T3> tuple)

      Allow to view a 3-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4> NTuple4<T1,T2,T3,T4> downCast(@NotNull
                                                                             NTuple4<? extends T1,? extends T2,? extends T3,? extends T4> tuple)

      Allow to view a 4-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5> NTuple5<T1,T2,T3,T4,T5> downCast(@NotNull
                                                                                   NTuple5<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5> tuple)

      Allow to view a 5-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> NTuple6<T1,T2,T3,T4,T5,T6> downCast(@NotNull
                                                                                         NTuple6<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6> tuple)

      Allow to view a 6-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> NTuple7<T1,T2,T3,T4,T5,T6,T7> downCast(@NotNull
                                                                                               NTuple7<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7> tuple)

      Allow to view a 7-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> NTuple8<T1,T2,T3,T4,T5,T6,T7,T8> downCast(@NotNull
                                                                                                     NTuple8<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8> tuple)

      Allow to view an 8-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
        `T8` - required eighth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> NTuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> downCast(@NotNull
                                                                                                           NTuple9<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8,? extends T9> tuple)

      Allow to view a 9-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
        `T8` - required eighth element type
        `T9` - required ninth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2> ITuple2<T1,T2> downCast(@NotNull
                                                                 ITuple2<? extends T1,? extends T2> tuple)

      Allow to view a 2-tuple as one with different more basic element types. This will not copy the tuple, this method is mostly useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required last element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3> ITuple3<T1,T2,T3> downCast(@NotNull
                                                                       ITuple3<? extends T1,? extends T2,? extends T3> tuple)

      Allow to view a 3-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4> ITuple4<T1,T2,T3,T4> downCast(@NotNull
                                                                             ITuple4<? extends T1,? extends T2,? extends T3,? extends T4> tuple)

      Allow to view a 4-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5> ITuple5<T1,T2,T3,T4,T5> downCast(@NotNull
                                                                                   ITuple5<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5> tuple)

      Allow to view a 5-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> ITuple6<T1,T2,T3,T4,T5,T6> downCast(@NotNull
                                                                                         ITuple6<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6> tuple)

      Allow to view a 6-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> ITuple7<T1,T2,T3,T4,T5,T6,T7> downCast(@NotNull
                                                                                               ITuple7<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7> tuple)

      Allow to view a 7-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> ITuple8<T1,T2,T3,T4,T5,T6,T7,T8> downCast(@NotNull
                                                                                                     ITuple8<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8> tuple)

      Allow to view an 8-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
        `T8` - required eighth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types

    - #### downCast

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> ITuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> downCast(@NotNull
                                                                                                           ITuple9<? extends T1,? extends T2,? extends T3,? extends T4,? extends T5,? extends T6,? extends T7,? extends T8,? extends T9> tuple)

      Allow to view a 9-tuple as one with different more basic element types. This will not copy the tuple nor create any object, this method is useful to avoid compiler warnings. The JIT should be able to remove it.
      Type Parameters:
        `T1` - required first element type
        `T2` - required second element type
        `T3` - required third element type
        `T4` - required fourth element type
        `T5` - required fifth element type
        `T6` - required sixth element type
        `T7` - required seventh element type
        `T8` - required eighth element type
        `T9` - required ninth element type
      Parameters:
        `tuple` - tuple to be viewed, with element types which are extensions of the required types
      Returns:
        `tuple` with adapted element types