static void throwExceptionIfConstructorWasNotFound ( Class < ? > type , Constructor < ? > potentialConstructor , Object ... arguments ) { if ( potentialConstructor == null ) { String message = "No constructor found in class '" + getOriginalUnmockedType ( type ) . getName ( ) + "' with " + "parameter types: [ " + getArgumentTypesAsString ( arguments ) + " ]." ; throw new ConstructorNotFoundException ( message ) ; } }
Throw exception if constructor was not found .