### Question:
Request implements Comparable<Request> { public static RequestBuilder builder() { return new RequestBuilder(); } private  Request(RequestBuilder b); static RequestBuilder builder(); @Override int compareTo(Request that); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void testRejectDuplicateHeaderNames() { Request.builder() .method("GET") .uri(URI.create("https: .header("Duplicate", "X") .header("Duplicate", "Y") .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testRejectDuplicateCaseInsensitiveHeaderNames() { Request.builder() .method("GET") .uri(URI.create("https: .header("Duplicate", "X") .header("DUPLICATE", "Y") .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testRejectDuplicateHeaderNamesMap() { Request.RequestBuilder builder = Request.builder() .method("GET") .uri(URI.create("https: .header("Duplicate", "X"); Map<String, String> headers = new HashMap<>(); headers.put("Duplicate", "y"); builder.headers(headers); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testRejectDuplicateHeaderNamesMixedCase() { Request.builder() .method("GET") .uri(URI.create("https: .header("Duplicate", "X") .header("DUPLICATE", "Y") .build(); }