ScopeVariableResolverFactory extends
        ReadOnlyVariableResolverFactory { public boolean isTarget(String name) { Request request = requestHolder.getTilesRequestContext(); if (name.endsWith("Scope")) { String scopeName = name.substring(0, name.length() - SCOPE_SUFFIX_LENGTH); for (String availableScope : request.getAvailableScopes()) { if (scopeName.equals(availableScope)) { return true; } } } return false; } ScopeVariableResolverFactory(TilesRequestContextHolder requestHolder); @Override VariableResolver createVariableResolver(String name); boolean isTarget(String name);  }
@Test public void testIsTarget() { replay(request, applicationContext); assertFalse(factory.isTarget("header")); assertTrue(factory.isTarget("requestScope")); assertTrue(factory.isTarget("applicationScope")); assertFalse(factory.isTarget("blah")); verify(request, applicationContext); }