@Test
public void providesInstanceProviderByParameter() throws Exception {

    DependencySupplierImpl dependencySupplier = createDependencySupplier("foo", -1);
    ParameterizedType stringProviderParameterizedType = newParameterizedType(Provider.class, String.class);
    Object instance = dependencySupplier.getInstance(createParameter(Provider.class, stringProviderParameterizedType, null));
    assertTrue(
            String.format("Instance of javax.inject.Provider expected but %s found", instance == null ? "null" : instance.getClass()),
            instance instanceof Provider);
    assertEquals("foo", ((Provider)instance).get());
}