@Test
public void returnsNullWhenListOfPathSegmentsIsEmptyAndDefaultValueIsNull() throws Exception {

    when(applicationContext.getUriInfo().getPathSegments(true)).thenReturn(newArrayList());
    Object resolvedMatrixParameter = matrixParameterResolver.resolve(parameter, applicationContext);
    assertNull(resolvedMatrixParameter);
    verify(typeProducer).createValue(eq("foo"), emptyMultivaluedMap(), (String)isNull());
}