@SuppressWarnings("unchecked")
@Test
public void testGetSourceAccessor() {

    Request request = createMock(Request.class);
    Map<String, Object> oneScope = createMock(Map.class);
    Map<String, Object> twoScope = createMock(Map.class);
    expect(request.getAvailableScopes()).andReturn(Arrays.asList(new String[] {"one", "two"})).anyTimes();
    expect(request.getContext("one")).andReturn(oneScope).anyTimes();
    expect(request.getContext("two")).andReturn(twoScope).anyTimes();
    expect(oneScope.containsKey("name1")).andReturn(true);
    expect(oneScope.containsKey("name2")).andReturn(false);
    expect(oneScope.containsKey("name3")).andReturn(false);
    expect(twoScope.containsKey("name2")).andReturn(true);
    expect(twoScope.containsKey("name3")).andReturn(false);
    replay(request, oneScope, twoScope);
    assertEquals(".getContext(\"one\").get(index)", accessor.getSourceAccessor(null, request, "name1"));
    assertEquals(".getContext(\"two\").get(index)", accessor.getSourceAccessor(null, request, "name2"));
    assertNull(accessor.getSourceAccessor(null, request, "name3"));
    verify(request, oneScope, twoScope);
}