class ExpiryCheckHandler {

    public static Optional<Integer> getExpireAfterConcerningCaseOfCorruptHeaderAndInfinite(MultiMap headers) {
        try {
            final Integer expireValue = getExpireValue(headers.get(EXPIRE_AFTER_HEADER));
            return Optional.ofNullable(expireValue);
        } catch (NumberFormatException e) {
            // Throwing exceptions is not allowed by design.
            // See: "https://github.com/swisspush/gateleen/pull/209#discussion_r177712751"
            log.warn("Conceal exception (because we're not allowed to throw by design): " + e.getClass().getSimpleName() + ": " + e.getMessage());
            return Optional.empty();
        }
    }

    private  ExpiryCheckHandler();

}