### Question:
ApnsPayloadBuilder { public ApnsPayloadBuilder setLocalizedAlertTitle(final String localizedAlertTitleKey, final String... alertTitleArguments) { this.localizedAlertTitleKey = localizedAlertTitleKey; this.localizedAlertTitleArguments = (alertTitleArguments != null && alertTitleArguments.length > 0) ? alertTitleArguments : null; this.alertTitle = null; return this; }  ApnsPayloadBuilder setPreferStringRepresentationForAlerts(final boolean preferStringRepresentationForAlerts); ApnsPayloadBuilder setAlertBody(final String alertBody); ApnsPayloadBuilder setLocalizedAlertMessage(final String localizedAlertKey, final String... alertArguments); ApnsPayloadBuilder setAlertTitle(final String alertTitle); ApnsPayloadBuilder setLocalizedAlertTitle(final String localizedAlertTitleKey, final String... alertTitleArguments); ApnsPayloadBuilder setAlertSubtitle(final String alertSubtitle); ApnsPayloadBuilder setLocalizedAlertSubtitle(final String localizedAlertSubtitleKey, final String... alertSubtitleArguments); ApnsPayloadBuilder setLaunchImageFileName(final String launchImageFilename); ApnsPayloadBuilder setShowActionButton(final boolean showActionButton); ApnsPayloadBuilder setActionButtonLabel(final String action); ApnsPayloadBuilder setLocalizedActionButtonKey(final String localizedActionButtonKey); ApnsPayloadBuilder setBadgeNumber(final Integer badgeNumber); ApnsPayloadBuilder setCategoryName(final String categoryName); @Deprecated ApnsPayloadBuilder setSoundFileName(final String soundFileName); ApnsPayloadBuilder setSound(final String soundFileName); ApnsPayloadBuilder setSound(final String soundFileName, final boolean isCriticalAlert, final double soundVolume); ApnsPayloadBuilder setContentAvailable(final boolean contentAvailable); ApnsPayloadBuilder setMutableContent(final boolean mutableContent); ApnsPayloadBuilder setThreadId(final String threadId); ApnsPayloadBuilder setTargetContentId(final String targetContentId); ApnsPayloadBuilder setSummaryArgument(final String summaryArgument); ApnsPayloadBuilder setSummaryArgumentCount(final Integer summaryArgumentCount); ApnsPayloadBuilder setUrlArguments(final List<String> arguments); ApnsPayloadBuilder setUrlArguments(final String... arguments); ApnsPayloadBuilder addCustomProperty(final String key, final Object value); abstract String build(); abstract String buildMdmPayload(final String pushMagicValue); static final String[] EMPTY_STRING_ARRAY; static final String DEFAULT_SOUND_FILENAME; }### Answer:
@Test void testSetLocalizedAlertTitle() { final String localizedAlertTitleKey = "alert.title"; this.builder.setAlertTitle("Alert title!"); this.builder.setLocalizedAlertTitle(localizedAlertTitleKey); { final Map<String, Object> aps = this.extractApsObjectFromPayloadString(this.builder.build()); @SuppressWarnings("unchecked") final Map<String, Object> alert = (Map<String, Object>) aps.get("alert"); assertEquals(localizedAlertTitleKey, alert.get("title-loc-key")); assertNull(alert.get("title-loc-args")); assertNull(alert.get("title")); } this.builder.setLocalizedAlertTitle(localizedAlertTitleKey, (String[]) null); final String[] alertArgs = new String[] { "Moose", "helicopter" }; this.builder.setLocalizedAlertTitle(localizedAlertTitleKey, alertArgs); { final Map<String, Object> aps = this.extractApsObjectFromPayloadString(this.builder.build()); @SuppressWarnings("unchecked") final Map<String, Object> alert = (Map<String, Object>) aps.get("alert"); assertEquals(localizedAlertTitleKey, alert.get("title-loc-key")); @SuppressWarnings("unchecked") final List<Object> argsArray = (List<Object>) alert.get("title-loc-args"); assertEquals(alertArgs.length, argsArray.size()); assertTrue(argsArray.containsAll(java.util.Arrays.asList(alertArgs))); } }