@SuppressWarnings("unchecked")
@Test
public void testMethodWithFilterAndRegion() throws SecurityException, NoSuchMethodException {
RegionFunctionContext functionContext = mock(RegionFunctionContext.class);
Region<Object, Object> region = mock(Region.class);
Method method = TestFunction.class.getDeclaredMethod("methodWithFilterAndRegion", Map.class, Set.class,
Object.class);
FunctionArgumentResolver far = new FunctionContextInjectingArgumentResolver(method);
Object[] originalArgs = new Object[]{new Object()};
when(functionContext.getArguments()).thenReturn(originalArgs);
when(functionContext.getDataSet()).thenReturn(region);
@SuppressWarnings("rawtypes")
Set keys = new HashSet<String>();
when(functionContext.getFilter()).thenReturn(keys);
Object[] args = far.resolveFunctionArguments(functionContext);
assertEquals(3, args.length);
assertSame(region, args[0]);