ResourceOptions { public ResourceOptions headers(Map<String, Object> headers) { FeatureException.throwIfNull(headers, "Please provide some headers"); this.headers.putAll(headers); return this; }  ResourceOptions securityTokenProvider(AuthorizationProvider provider); ResourceOptions header(String name, Object value); ResourceOptions headers(Map<String, Object> headers); ResourceOptions scope(String scope); ResourceOptions group(String group); Map<String, Object> headers(); Optional<Authorization> supplyToken(); String scope(); String group();  }
@Test public void testHeaders() { ResourceOptions ro = new ResourceOptions(); try { ro.headers(null); fail(); } catch (Exception ignored) { } final HashMap<String, Object> headers = Maps.newHashMap(); headers.put("Foo", "Bar"); ro.headers(headers).headers(); headers.put("Baz", "Quux"); ro.headers(headers).headers(); ro.header("A", "B"); final HashMap<String, Object> headers1 = Maps.newHashMap(); headers1.put("Foo", "Bar"); headers1.put("Baz", "Quux"); headers1.put("A", "B"); assertEquals(headers1, ro.headers()); }