### Question:
CardBuilder { @NonNull public static String maskPan(String pan) { checkArgument(pan != null && pan.length() >= MIN_PAN_LENGTH, "PAN must be >= " + MIN_PAN_LENGTH + " in length"); byte[] bytes = pan.getBytes(); Arrays.fill(bytes, START_PAN_OFFSET, bytes.length - END_PAN_OFFSET, X_CHAR); return new String(bytes); }  @NonNull CardBuilder withMaskedPan(String maskedPan); @NonNull CardBuilder withCardholderName(String cardholderName); @NonNull CardBuilder withExpiryDate(String expiryDate); CardBuilder withCardToken(Token cardToken); @NonNull CardBuilder withAdditionalData(AdditionalData additionalData); @NonNull CardBuilder withAdditionalData(String key, T... values); @NonNull Card build(); @NonNull static String maskPan(String pan);  }### Answer:
@Test public void shouldMaskPanCorrectly() throws Exception { String maskedPan = CardBuilder.maskPan("1234123412341234"); assertThat(maskedPan).isEqualTo("123412XXXXXX1234"); }