### Question:
RtcDefectAdapter implements DefectAdapter { void addCookies(Map<String, String> cookies, HttpHeaders headers) { StringBuilder builder = new StringBuilder(); for (Map.Entry<String, String> entry : cookies.entrySet()) { if (builder.length() > 0) { builder.append("; "); } builder.append(entry.getKey()).append("=").append(entry.getValue()); } headers.add(HttpHeaders.COOKIE, builder.toString()); } @Autowired  RtcDefectAdapter(SettingService settingService,
                            RestTemplateBuilder restTemplateBuilder,
                            RtcDateTimeAdapter rtcDateTimeAdapter,
                            SettingProviderService settingProviderService); @Override List<Defect> getStatuses(long projectId, List<String> ids); @Override List<Defect> getChangedDefects(long projectId, Date since); @Override boolean isValidId(long projectId, String id); @Override String getIdFormatHint(long projectId); @Override String getCode(); @Override String getName(); @Override List<SettingDTO> getSettingDefinitions();  }### Answer:
@Test public void addCookies_should_add_cookies() { Map<String, String> cookies = new HashMap<>(); cookies.put("key1", "value1"); cookies.put("key2", "value2"); HttpHeaders headers = new HttpHeaders(); cut.addCookies(cookies, headers); assertThat(headers.getFirst("Cookie")).isIn( "key1=value1; key2=value2", "key2=value2; key1=value1"); }