code: private <T> T getServiceAndExecute(Function<OsgiResourceLocator, T> function) {
  		// hook into OSGi-Framework
  		final BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
  		// get-service, execute function, and unget-service
  		ServiceReference<OsgiResourceLocator> serviceRef = context.getServiceReference(OsgiResourceLocator.class);
  		T resourceQueryResult = null;
  		if (serviceRef != null) {
  			final OsgiResourceLocator resourceLocatorService = context.getService(serviceRef);
  			if (resourceLocatorService != null) {
  				resourceQueryResult = function.apply(resourceLocatorService);
  			}
  			context.ungetService(serviceRef);
  		}
  		return resourceQueryResult;
  	}
docs: Gets a {@link OsgiResourceLocator}-service, applies the given function,
  and ungets the service.
  
  @param function the function to apply against the {@link OsgiResourceLocator}
  @return a {@link Resource}, {@link ViewResource} depending on the
  functions or {@code null}.