public static <T> T checkFound(@Nullable T value, String message, Object... messageArguments) {
    if (value == null) {
      throw new NotFoundException(format(message, messageArguments));
    }

    return value;
  }
@Test
  public void checkFound_type_throws_NotFoundException_if_parameter_is_null_and_formats_message() {
    String message = "foo %s";
    assertThatExceptionOfType(NotFoundException.class)
      .isThrownBy(() -> checkFound(null, message, "bar"))
      .withMessage("foo bar");
  }