@Test
public void returnsDefaultValueWhenListOfPathSegmentsIsEmpty() throws Exception {

    when(parameter.getDefaultValue()).thenReturn("default value");
    when(typeProducer.createValue(eq("foo"), emptyMultivaluedMap(), eq("default value"))).thenReturn("default value");
    when(applicationContext.getUriInfo().getPathSegments(true)).thenReturn(newArrayList());
    Object resolvedMatrixParameter = matrixParameterResolver.resolve(parameter, applicationContext);
    assertEquals("default value", resolvedMatrixParameter);
}