SolrServerConfiguration { public S getProvider() throws IllegalAccessException, InvocationTargetException, InstantiationException { if (constructor == null) { Class<?> rawType = type instanceof Class<?> ? (Class<?>) type : (Class<?>) ((ParameterizedType) type).getRawType(); Constructor<?>[] constructors = rawType.getConstructors(); for (Constructor<?> c: constructors) { if (c.getParameterTypes().length == 1 && c.getParameterTypes()[0].equals(this.getClass())) { constructor = c; } } if (constructor == null) { throw new InstantiationException("missing constructor SolrServerProvider(SolrServerConfiguration) for type "+ rawType); } } return (S) constructor.newInstance(this); } protected  SolrServerConfiguration(); Type getType(); S getProvider();  }
@Test public void testCreateRemoteServerFromConfig() throws Exception { SolrServerConfiguration<RemoteSolrServerProvider> remoteSolrServerProviderSolrServerConfiguration = new RemoteSolrServerConfiguration(null, null, 1, 1, null, 10, 10, null); RemoteSolrServerProvider remoteSolrServerProvider = remoteSolrServerProviderSolrServerConfiguration.getProvider(); assertNotNull(remoteSolrServerProvider); }
@Test public void testCreteEmbeddedServerFromConfig() throws Exception { SolrServerConfiguration<EmbeddedSolrServerProvider> embeddedSolrServerSolrServerConfiguration = new EmbeddedSolrServerConfiguration(null, null); EmbeddedSolrServerProvider embeddedSolrServerProvider = embeddedSolrServerSolrServerConfiguration.getProvider(); assertNotNull(embeddedSolrServerProvider); }