public static <T> T checkNotNull(T reference,
                                   String errorMessageTemplate,
                                   Object... errorMessageArgs) {
    if (reference == null) {
      // If either of these parameters is null, the right thing happens anyway
      throw new NullPointerException(
          format(errorMessageTemplate, errorMessageArgs));
    }
    return reference;
  }
@Test
  void checkNotNullInputNullNotNullNullOutputNullPointerException() {
    assertThatExceptionOfType(NullPointerException.class).isThrownBy(() -> {
      // Arrange
      final Object reference = null;
      final String errorMessageTemplate = "";
      final Object[] errorMessageArgs = null;
      Util.checkNotNull(reference, errorMessageTemplate, errorMessageArgs);
      // Method is not expected to return due to exception thrown
    });
    // Method is not expected to return due to exception thrown
  }