Vary implements Serializable { public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Vary vary = (Vary) o; if (varyHeaders != null ? !varyHeaders.equals(vary.varyHeaders) : vary.varyHeaders != null) { return false; } return true; } Vary();  Vary(final Map<String, String> headers);  Vary(Headers headers); int size(); boolean isEmpty(); boolean matches(final HTTPRequest request); @Override String toString(); Map<String, String> getVaryHeaders(); static Vary parse(String value); boolean equals(final Object o); int hashCode(); static final Vary ALL; }
@Test public void testVaryFileResolve() { FileManager resolver = new FileManager(TestUtil.getTestFile("target")); File file = resolver.resolve(Key.create(URI.create("foo"), new Vary())); File file2 = resolver.resolve(Key.create(URI.create("foo"), new Vary())); File file3 = resolver.resolve(Key.create(URI.create("foo"), new Vary(new HashMap<String, String>()))); File file4 = resolver.resolve(Key.create(URI.create("foo"), new Vary(Collections.singletonMap("Accept-Language", "en")))); assertEquals(file.getAbsolutePath(), file2.getAbsolutePath()); assertEquals(file.getAbsolutePath(), file3.getAbsolutePath()); assertEquals(file2.getAbsolutePath(), file3.getAbsolutePath()); assertEquals(file2.getAbsolutePath(), file3.getAbsolutePath()); assertFalse(file4.getAbsolutePath().equals(file3.getAbsolutePath())); }