### Question:
ApiClient { public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); } ApiClient(); static DateFormat buildDefaultDateFormat(); ApiClient rebuildHttpClient(); ObjectMapper getObjectMapper(); ApiClient setObjectMapper(ObjectMapper objectMapper); Client getHttpClient(); ApiClient setHttpClient(Client httpClient); String getBasePath(); ApiClient setBasePath(String basePath); List<ServerConfiguration> getServers(); ApiClient setServers(List<ServerConfiguration> servers); Integer getServerIndex(); ApiClient setServerIndex(Integer serverIndex); Map<String, String> getServerVariables(); ApiClient setServerVariables(Map<String, String> serverVariables); int getStatusCode(); Map<String, List<String>> getResponseHeaders(); Map<String, Authentication> getAuthentications(); Authentication getAuthentication(String authName); void setUsername(String username); void setPassword(String password); void setApiKey(String apiKey); void setApiKeyPrefix(String apiKeyPrefix); void setAccessToken(String accessToken); ApiClient setUserAgent(String userAgent); ApiClient addDefaultHeader(String key, String value); ApiClient addDefaultCookie(String key, String value); boolean isDebugging(); ApiClient setDebugging(boolean debugging); int getConnectTimeout(); ApiClient setConnectTimeout(int connectionTimeout); DateFormat getDateFormat(); ApiClient setDateFormat(DateFormat dateFormat); Date parseDate(String str); String formatDate(Date date); String parameterToString(Object param); List<Pair> parameterToPair(String name, Object value); List<Pair> parameterToPairs(String collectionFormat, String name, Collection value); boolean isJsonMime(String mime); String selectHeaderAccept(String[] accepts); String selectHeaderContentType(String[] contentTypes); String escapeString(String str); Object serialize(Object obj, String contentType, Map<String, Object> formParams); T invokeAPI(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType);  }### Answer:
@Test public void testSelectHeaderAccept() { String[] accepts = {"application/json", "application/xml"}; assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); accepts = new String[]{"text/plain", "application/xml"}; assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); accepts = new String[]{}; assertNull(apiClient.selectHeaderAccept(accepts)); }