public static SimpleDateFormat formatFor(final String pattern) {
            final SoftReference<Map<String, SimpleDateFormat>> ref = THREADLOCAL_FORMATS.get();
            Map<String, SimpleDateFormat> formats = ref == null ? null : ref.get();
            if (formats == null) {
                formats = new HashMap<>();
                THREADLOCAL_FORMATS.set(new SoftReference<>(formats));
            }

            SimpleDateFormat format = formats.get(pattern);
            if (format == null) {
                format = new SimpleDateFormat(pattern, Locale.US);
                format.setTimeZone(TimeZone.getTimeZone("GMT"));
                formats.put(pattern, format);
            }

            return format;
        }
creates a {@link SimpleDateFormat} for the requested format string.

@param pattern
           a non-{@code null} format String according to
           {@link SimpleDateFormat}. The format is not checked against
           {@code null} since all paths go through
           {@link DateUtils}.
@return the requested format. This simple dateformat should not be used
        to {@link SimpleDateFormat#applyPattern(String) apply} to a
        different pattern.
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java