public T get(final int index) {
    if (index < 0 || index >= values.size()) {
      throw new IndexOutOfBoundsException(
              String.format(
                      "Attempted to access variadic argument at index %s when only %s "
                      + "arguments are available",
                      index,
                      values.size()
              )
      );
    }

    return values.get(index);
  }
@Test
  public void shouldThrowWhenIndexTooLarge() {
    final VariadicArgs<Integer> varArgs = new VariadicArgs<>(ImmutableList.of(1, 2, 3));

    final Exception e = assertThrows(
            IndexOutOfBoundsException.class,
            () -> varArgs.get(3)
    );

    assertThat(e.getMessage(), is("Attempted to access variadic argument at index 3 when only 3 "
            + "arguments are available"));
  }