public static void updateServerTimestampHeader(MultiMap headers){
  String serverTimestamp=headers.get(SERVER_TIMESTAMP_HEADER);
  if (serverTimestamp == null) {
    String nowAsISO=dfISO8601.print(Instant.now());
    log.debug("Setting " + SERVER_TIMESTAMP_HEADER + " value to "+ nowAsISO+ "  since header "+ SERVER_TIMESTAMP_HEADER+ " is not defined");
    headers.set(SERVER_TIMESTAMP_HEADER,nowAsISO);
  }
 else {
    String updatedTimestamp=localizeTimestamp(serverTimestamp);
    if (!updatedTimestamp.equals(serverTimestamp)) {
      log.debug("Updating" + SERVER_TIMESTAMP_HEADER + " value from "+ serverTimestamp+ "  to "+ updatedTimestamp);
      headers.remove(SERVER_TIMESTAMP_HEADER);
      headers.set(SERVER_TIMESTAMP_HEADER,updatedTimestamp);
    }
  }
}

public static void updateServerTimestampHeader ( MultiMap headers ) { String serverTimestamp = headers . get ( SERVER_TIMESTAMP_HEADER ) ; if ( serverTimestamp == null ) { String nowAsISO = dfISO8601 . print ( Instant . now ( ) ) ; log . debug ( "Setting " + SERVER_TIMESTAMP_HEADER + " value to " + nowAsISO + "  since header " + SERVER_TIMESTAMP_HEADER + " is not defined" ) ; headers . set ( SERVER_TIMESTAMP_HEADER , nowAsISO ) ; } else { String updatedTimestamp = localizeTimestamp ( serverTimestamp ) ; if ( ! updatedTimestamp . equals ( serverTimestamp ) ) { log . debug ( "Updating" + SERVER_TIMESTAMP_HEADER + " value from " + serverTimestamp + "  to " + updatedTimestamp ) ; headers . remove ( SERVER_TIMESTAMP_HEADER ) ; headers . set ( SERVER_TIMESTAMP_HEADER , updatedTimestamp ) ; } } }
checks if a " x - server - timestamp " header is set or not . if no valid value is found , the actual timestamp is set .
