### Question:
CardUtils { static boolean isValidLuhnNumber(@Nullable String cardNumber) { if (cardNumber == null) { return false; } boolean isOdd = true; int sum = 0; for (int index = cardNumber.length() - 1; index >= 0; index--) { char c = cardNumber.charAt(index); if (!Character.isDigit(c)) { return false; } int digitInteger = Character.getNumericValue(c); isOdd = !isOdd; if (isOdd) { digitInteger *= 2; } if (digitInteger > 9) { digitInteger -= 9; } sum += digitInteger; } return sum % 10 == 0; }  @NonNull @Card.CardBrand static String getPossibleCardType(@Nullable String cardNumber); static boolean isValidCardNumber(@Nullable String cardNumber);  }### Answer:
@Test public void isValidLuhnNumber_whenValidVisaNumber_returnsTrue() { assertTrue(CardUtils.isValidLuhnNumber("4242424242424242")); }
@Test public void isValidLuhnNumber_whenValidJCBNumber_returnsTrue() { assertTrue(CardUtils.isValidLuhnNumber("3530111333300000")); }
@Test public void isValidLuhnNumber_whenValidDiscover_returnsTrue() { assertTrue(CardUtils.isValidLuhnNumber("6011000990139424")); }
@Test public void isValidLuhnNumber_whenValidDinersClub_returnsTrue() { assertTrue(CardUtils.isValidLuhnNumber("30569309025904")); }
@Test public void isValidLuhnNumber_whenValidMasterCard_returnsTrue() { assertTrue(CardUtils.isValidLuhnNumber("5555555555554444")); }
@Test public void isValidLuhnNumber_whenValidAmEx_returnsTrue() { assertTrue(CardUtils.isValidLuhnNumber("378282246310005")); }
@Test public void isValidLunhNumber_whenNumberIsInvalid_returnsFalse() { assertFalse(CardUtils.isValidLuhnNumber("4242424242424243")); }
@Test public void isValidLuhnNumber_whenInputIsNull_returnsFalse() { assertFalse(CardUtils.isValidLuhnNumber(null)); }
@Test public void isValidLuhnNumber_whenInputIsNotNumeric_returnsFalse() { assertFalse(CardUtils.isValidLuhnNumber("abcdefg")); assertFalse(CardUtils.isValidLuhnNumber("4242 4242 4242 4242")); assertFalse(CardUtils.isValidLuhnNumber("4242-4242-4242-4242")); }