code: @Nonnull
    private static <T extends AbstractSingleton> T _instantiateSingleton (@Nonnull final Class <T> aClass,
                                                                          @Nonnull final IScope aScope)
    {
      // create new object in passed scope
      try
      {
        if (LOGGER.isDebugEnabled ())
          LOGGER.debug ("Created singleton for '" + aClass.toString () + "' in scope " + aScope.toString ());
  
        // Check if class is public, non-abstract etc.
        if (!ClassHelper.isPublicClass (aClass))
          throw new IllegalStateException ("Class " + aClass.toString () + " is not instancable!");
  
        // First check, if constructor is present, that takes an IScope argument
        try
        {
          final Constructor <T> aCtor = aClass.getDeclaredConstructor (IScope.class);
  
          // Invoke ctor with scope
          return aCtor.newInstance (aScope);
        }
        catch (final NoSuchMethodException ex)
        {
          // Fall through to default ctor
        }
  
        // Alternatively find the no-argument constructor
        final Constructor <T> aCtor = aClass.getDeclaredConstructor ((Class <?> []) null);
  
        // Don't call "aCtor.setAccessible ()" because on
        // Ubuntu: java.security.AccessControlException: access denied
        // (java.lang.reflect.ReflectPermission suppressAccessChecks)
  
        // Invoke default ctor
        return aCtor.newInstance ((Object []) null);
      }
      catch (final RuntimeException ex)
      {
        throw ex;
      }
      catch (final Exception ex)
      {
        throw new IllegalStateException ("Error instantiating singleton of class " +
                                         aClass.getName () +
                                         " in scope " +
                                         aScope.toString (),
                                         ex);
      }
    }
docs: Instantiate singleton using reflection. The passed class must be a public
  class. First a public constructor with a single argument of type
  {@link IScope} is searched. If not found the public no-argument constructor
  is searched.
  
  @param aClass
  The class to instantiate. May not be <code>null</code>.
  @param aScope
  The scope to be passed to the instantiated class. Never
  <code>null</code>.,
  @return Never <code>null</code>.
  @throws IllegalStateException
  If instantiation failed