### Question:
ContentNegotiator { public ContentType doContentNegotiation(final ODataRequest odataRequest, final UriInfoImpl uriInfo, final List<String> supportedContentTypes) throws ODataException { validateNotNull(odataRequest, uriInfo, supportedContentTypes); if (uriInfo.isCount()) { return ContentType.TEXT_PLAIN_CS_UTF_8; } else if (uriInfo.isValue()) { if (uriInfo.getUriType() == UriType.URI5 || uriInfo.getUriType() == UriType.URI4) { return ContentType.TEXT_PLAIN_CS_UTF_8; } return doContentNegotiationForAcceptHeader(Arrays.asList("*/*"), ContentType.create(supportedContentTypes)); } if (uriInfo.getFormat() == null) { return doContentNegotiationForAcceptHeader(odataRequest.getAcceptHeaders(), ContentType .create(supportedContentTypes)); } else { return doContentNegotiationForFormat(uriInfo, ContentType.createAsCustom(supportedContentTypes)); } }  ContentType doContentNegotiation(final ODataRequest odataRequest, final UriInfoImpl uriInfo,
      final List<String> supportedContentTypes);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void invalidContentNegotiatorCreation() throws ODataException { final ContentType contentType = new ContentNegotiator().doContentNegotiation(null, null, null); assertNull(contentType); }
@Test(expected = IllegalArgumentException.class) public void invalidContentNegotiatorCreationNullRequest() throws ODataException { UriInfoImpl uriInfo = Mockito.mock(UriInfoImpl.class); final ContentType contentType = new ContentNegotiator().doContentNegotiation(null, uriInfo, new ArrayList<String>()); assertNull(contentType); }
@Test(expected = IllegalArgumentException.class) public void invalidContentNegotiatorCreationNullUri() throws ODataException { ODataRequest request = Mockito.mock(ODataRequest.class); final ContentType contentType = new ContentNegotiator().doContentNegotiation(request, null, new ArrayList<String>()); assertNull(contentType); }
@Test(expected = IllegalArgumentException.class) public void invalidContentNegotiatorCreationNullSupported() throws ODataException { ODataRequest request = Mockito.mock(ODataRequest.class); UriInfoImpl uriInfo = Mockito.mock(UriInfoImpl.class); final ContentType contentType = new ContentNegotiator().doContentNegotiation(request, uriInfo, null); assertNull(contentType); }