CacheHeader { public static void setExpires(@NotNull HttpServletResponse response, @Nullable Date date) { if (date == null) { response.setHeader(HEADER_EXPIRES, "-1"); } else { response.setHeader(HEADER_EXPIRES, formatDate(date)); } } private  CacheHeader(); static boolean isNotModified(@NotNull Resource resource,
      @NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response); static boolean isNotModified(@NotNull Resource resource,
      @NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response, boolean setExpiresHeader); static boolean isNotModified(@NotNull ModificationDateProvider dateProvider,
      @NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response); static boolean isNotModified(@NotNull ModificationDateProvider dateProvider,
      @NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response, boolean setExpiresHeader); static void setNonCachingHeaders(@NotNull HttpServletResponse response); static void setExpires(@NotNull HttpServletResponse response, @Nullable Date date); static void setExpiresSeconds(@NotNull HttpServletResponse response, int seconds); static void setExpiresHours(@NotNull HttpServletResponse response, int hours); static void setExpiresDays(@NotNull HttpServletResponse response, int days);  }
@Test void testSetExpires() { CacheHeader.setExpires(response, null); verify(response).setHeader(CacheHeader.HEADER_EXPIRES, "-1"); Date date = new Date(); CacheHeader.setExpires(response, date); verify(response).setHeader(CacheHeader.HEADER_EXPIRES, formatDate(date)); }