public static <T> Constructor<T> getConstructor(Class<T> cls, Class[] args)
    {
        try
        {
            return cls.getConstructor(args);
        }
        catch (NoSuchMethodException e)
        {
            throw new IllegalStateException(e);
        }
    }
public static <T> Constructor<T> getConstructor(Class<T> cls, Class[] args)
    {
        try
        {
            return cls.getConstructor(args);
        }
        catch (NoSuchMethodException e)
        {
            throw new IllegalStateException(e);
        }
    }
public static < T > Constructor < T > getConstructor ( Class < T > cls , Class [ ] args ) { try { return cls . getConstructor ( args ) ; } catch ( NoSuchMethodException e ) { throw new IllegalStateException ( e ) ; } }
Gets the constructor of a class that takes the specified set of arguments if any matches. If no matching
constructor is found then a runtime exception is raised.

@param  cls  The class to get a constructor from.
@param  args The arguments to match.
@param  <T>  The class type.

@return The constructor.
Gets the constructor of a class that takes the specified set of arguments if any matches . If no matching constructor is found then a runtime exception is raised .