### Question:
AbstractDRResourceProvider extends AbstractResourceProvider { public static ResourceProvider getResourceProvider(Resource.Type type, IvoryService service) { switch (type.getInternalType()) { case DRFeed: return new FeedResourceProvider(service); case DRTargetCluster: return new TargetClusterResourceProvider(service); case DRInstance: return new InstanceResourceProvider(service); default: throw new IllegalArgumentException("Unknown type " + type); } } protected  AbstractDRResourceProvider(Set<String> propertyIds,
                                       Map<Resource.Type, String> keyPropertyIds,
                                       IvoryService ivoryService); static ResourceProvider getResourceProvider(Resource.Type type,
                                                     IvoryService service);  }### Answer:
@Test public void testGetResourceProvider() throws Exception { Set<String> propertyIds = new HashSet<>(); propertyIds.add("foo"); propertyIds.add("cat1/foo"); propertyIds.add("cat2/bar"); propertyIds.add("cat2/baz"); propertyIds.add("cat3/sub1/bam"); propertyIds.add("cat4/sub2/sub3/bat"); propertyIds.add("cat5/subcat5/map"); Map<Resource.Type, String> keyPropertyIds = new HashMap<>(); IvoryService ivoryService = createMock(IvoryService.class); AbstractResourceProvider provider = (AbstractResourceProvider) AbstractDRResourceProvider.getResourceProvider( Resource.Type.DRFeed, ivoryService); Assert.assertTrue(provider instanceof FeedResourceProvider); }