### Question:
MapperUtils { public static <I, O> Mapper<I, O> nullSafe(Mapper<I, O> mapper) { return input -> { if (input == null) { return null; } return mapper.map(input); }; } private  MapperUtils(); static List<O> mapCollection(Mapper<I, O> mapper, Collection<I> input); static Mapper<I, O> nullSafe(Mapper<I, O> mapper);  }### Answer:
@Test void shouldReturnNullWhenNullSafeAndInputIsNull() { Mapper<String, Integer> nullSafeMapper = MapperUtils.nullSafe(mapper); assertThat(nullSafeMapper.map(null)).isEqualTo(null); }
@Test void shouldReturnMappedInputWhenNullSafeAndInputIsNotNull() { Mapper<String, Integer> nullSafeMapper = MapperUtils.nullSafe(mapper); assertThat(nullSafeMapper.map("1")).isEqualTo(1); }