### Question:
LuhnCheckDigitFunction implements Function<Long, Long> { @Override @Nullable public Long apply(@Nonnull Long partialAccountNumber) { checkNotNull(partialAccountNumber, "partialAccountNumber can't be null"); boolean isEven = true; int total = 0; Long temp = partialAccountNumber; while (temp > 0) { long digit = temp % 10; if (isEven) { long multipliedDigit = digit * 2; total += isTwoDigit(multipliedDigit) ? sumUpDigits(multipliedDigit) : multipliedDigit; } else { total += digit; } temp /= 10; isEven = !isEven; } int check = total * 9 % 10; return partialAccountNumber * 10 + check; }  @Override @Nullable Long apply(@Nonnull Long partialAccountNumber);  }### Answer:
@Test public void shouldGeneratedLuhnNumber() { LuhnCheckDigitFunction luhnCheckDigitFunction = new LuhnCheckDigitFunction(); assertThat(luhnCheckDigitFunction.apply(7992739871L), is(79927398713L)); }
@Test public void shouldGeneratedLuhnNumberForOneDigitNumber() { LuhnCheckDigitFunction luhnCheckDigitFunction = new LuhnCheckDigitFunction(); assertThat(luhnCheckDigitFunction.apply(5L), is(59L)); }
@Test public void shouldGeneratedLuhnNumberForTwoDigitNumber() { LuhnCheckDigitFunction luhnCheckDigitFunction = new LuhnCheckDigitFunction(); assertThat(luhnCheckDigitFunction.apply(23L), is(232L)); }
@Test public void shouldGeneratedLuhnNumberForZero() { LuhnCheckDigitFunction luhnCheckDigitFunction = new LuhnCheckDigitFunction(); assertThat(luhnCheckDigitFunction.apply(0L), is(0L)); }