public static String generateApply(
      final String inputCode,
      final String mapperCode,
      final Class<?> returnType
  ) {
    return "((" + returnType.getSimpleName() + ")" + NullSafe.class.getSimpleName()
        + ".apply(" + inputCode + "," + mapperCode + "))";
  }
@Test
  public void shouldGenerateApply() {
    // Given:
    final String mapperCode = LambdaUtil
        .toJavaCode("val", Long.class, "val.longValue() + 1");

    // When:
    final String javaCode = NullSafe
        .generateApply("arguments.get(\"input\")", mapperCode, Long.class);

    // Then:
    final Evaluator evaluator = CodeGenTestUtil.cookCode(javaCode, Long.class);
    assertThat(evaluator.evaluate("input", 10L), is(11L));
    assertThat(evaluator.evaluate("input", null), is(nullValue()));
  }