public static <T> T createPartialMockAndInvokeDefaultConstructor(Class<T> type, String... methodNames)
            throws Exception {
        return createMock(type, new ConstructorArgs(Whitebox.getConstructor(type)),
                Whitebox.getMethods(type, methodNames));
    }
public static < T > T createPartialMockAndInvokeDefaultConstructor ( Class < T > type , String ... methodNames ) throws Exception { return createMock ( type , new ConstructorArgs ( Whitebox . getConstructor ( type ) ) , Whitebox . getMethods ( type , methodNames ) ) ; }
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock). The
mock object created will support mocking of final methods and invokes the
default constructor (even if it's private).

@param <T>         the type of the mock object
@param type        the type of the mock object
@param methodNames The names of the methods that should be mocked. If
{@code null}, then this method will have the same effect
as just calling {@link #createMock(Class, Method...)} with the
second parameter as {@code new Method[0]} (i.e. all
methods in that class will be mocked).
@return the mock object.