### Question:
UserProvider extends AbstractHttpContextInjectable<Principal> implements
  InjectableProvider<Context, Type> { public static void setUserPattern(String pattern) { userPattern = Pattern.compile(pattern); }  static void setUserPattern(String pattern); static Pattern getUserPattern(); @Override Principal getValue(HttpContext httpContext); @Override ComponentScope getScope(); @Override Injectable getInjectable(ComponentContext componentContext, Context context, Type type); static final String USER_NAME_PARAM; static final String USER_PATTERN_KEY; static final String USER_PATTERN_DEFAULT; }### Answer:
@Test public void customUserPattern() { try { UserProvider.setUserPattern("1"); new UserProvider.UserParam("1"); } finally { UserProvider.setUserPattern(UserProvider.USER_PATTERN_DEFAULT); } }