CacheControl { public abstract CacheControlBuilder toBuilder(); CacheControl(boolean noCache, boolean noStore, boolean noTransform, long maxAgeSeconds); boolean isEmpty(); final boolean noCache(); final boolean noStore(); final boolean noTransform(); final long maxAgeSeconds(); abstract CacheControlBuilder toBuilder(); abstract String asHeaderValue(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testToBuilder() { final CacheControl cc = new CacheControlImplBuilder().noCache() .noStore() .noTransform() .maxAgeSeconds(3600) .build(); assertThat(cc.asHeaderValue()).isEqualTo("no-cache, no-store, no-transform, max-age=3600"); assertThat(cc.toBuilder().build()).isEqualTo(cc); assertThat(cc.toBuilder() .noCache(false) .noStore(false) .noTransform(false) .maxAge(null) .build().isEmpty()).isTrue(); }