### Question:
SearchParamRegistryImpl implements ISearchParamRegistry { @Override public Map<String, RuntimeSearchParam> getActiveSearchParams(String theResourceName) { requiresActiveSearchParams(); return getActiveSearchParams().get(theResourceName); }  @Override RuntimeSearchParam getActiveSearchParam(String theResourceName, String theParamName); @Override Map<String, RuntimeSearchParam> getActiveSearchParams(String theResourceName); @Override List<JpaRuntimeSearchParam> getActiveUniqueSearchParams(String theResourceName); @Override List<JpaRuntimeSearchParam> getActiveUniqueSearchParams(String theResourceName, Set<String> theParamNames); @PostConstruct void start(); @PreDestroy void stop(); int doRefresh(long theRefreshInterval); @Override RuntimeSearchParam getSearchParamByName(RuntimeResourceDefinition theResourceDef, String theParamName); @Override Collection<RuntimeSearchParam> getSearchParamsByResourceType(RuntimeResourceDefinition theResourceDef); @Override void requestRefresh(); @Override void forceRefresh(); @PostConstruct void scheduleJob(); @Override boolean refreshCacheIfNecessary(); @Override Map<String, Map<String, RuntimeSearchParam>> getActiveSearchParams(); @Override void setPhoneticEncoder(IPhoneticEncoder thePhoneticEncoder); static Map<String, Map<String, RuntimeSearchParam>> createBuiltInSearchParamMap(FhirContext theFhirContext);  }### Answer:
@Test public void testGetActiveSearchParams() { when(mySearchParamProvider.search(any())).thenReturn(new SimpleBundleProvider()); when(mySearchParamProvider.refreshCache(any(), anyLong())).thenAnswer(t -> { if (myAnswerCount == 0) { myAnswerCount++; throw new InternalErrorException("this is an error!"); } mySearchParamRegistry.doRefresh(0); return 0; }); Map<String, RuntimeSearchParam> outcome = mySearchParamRegistry.getActiveSearchParams("Patient"); }