BaseTypeRegistry implements WritableTypeRegistry { @Nonnull @Override public PServiceProvider getServiceProvider(final String serviceName, final String programContext) { return () -> getService(serviceName, programContext); } protected  BaseTypeRegistry(); @Override void registerTypedef(@Nonnull String identifier,
                                @Nonnull String program,
                                @Nonnull String target); @Nonnull @Override @SuppressWarnings("unchecked") PDescriptorProvider getProvider(@Nonnull String name,
                                           @Nonnull final String context,
                                           @Nullable Map<String, String> annotations); @Nonnull @Override PServiceProvider getServiceProvider(final String serviceName, final String programContext); @Override void registerRecursively(@Nonnull PService service); @Override void registerRecursively(PDeclaredDescriptor<T> declaredType);  }
@Test public void testGetServiceProvider() { PServiceProvider srv = registry.getServiceProvider("calculator.Calculator2", "number"); assertThat(srv.getService(), is(Calculator2.kDescriptor)); assertThat(srv.getService().getExtendsService(), is(Calculator.kDescriptor)); }