### Question:
SoapClientHandler implements SoapClientHandlerInterface<T> { protected Object[] processSoapArguments(Method soapClientMethod, Object[] args) { if (args == null) { return null; } int argsCount = Math.max(soapClientMethod.getParameterTypes().length, args.length); return Arrays.copyOf(args, argsCount); } protected  SoapClientHandler(); @Override Method getSoapClientMethod(T soapClient, Method method);  }### Answer:
@Test public void testProcessArgs() throws Exception { Object[] args = new Object[] {new Object[] {1.0d, "2", 3L}, "4"}; Object[] processedArgs = soapClientHandler.processSoapArguments(MockSoapClient.class.getMethod("lotsOfArgsCall", Object.class, Object[].class, Object.class, Object.class), args); assertEquals(args[0], processedArgs[0]); assertEquals(args[1], processedArgs[1]); assertNull(processedArgs[2]); assertNull(processedArgs[3]); assertEquals(4, processedArgs.length); }
@Test public void testProcessArgs_emptyArgs() throws Exception { Object[] args = new Object[] {}; Object[] processedArgs = soapClientHandler.processSoapArguments(MockSoapClient.class.getMethod("lotsOfArgsCall", Object.class, Object[].class, Object.class, Object.class), args); assertNull(processedArgs[0]); assertNull(processedArgs[1]); assertNull(processedArgs[2]); assertNull(processedArgs[3]); assertEquals(4, processedArgs.length); }
@Test public void testProcessArgs_emptyMethod() throws Exception { Object[] args = new Object[] {}; Object[] processedArgs = soapClientHandler.processSoapArguments(MockSoapClient.class.getMethod("emptyCall"), args); assertEquals(0, processedArgs.length); }
@Test public void testProcessArgs_null() throws Exception { Object[] args = null; Object[] processedArgs = soapClientHandler.processSoapArguments(MockSoapClient.class.getMethod("emptyCall"), args); assertNull(processedArgs); }
@Test public void testProcessArgs_tooMany() throws Exception { Object[] args = new Object[] {new Object[] {1.0d, "2", 3L}, "4"}; Object[] processedArgs = soapClientHandler.processSoapArguments(MockSoapClient.class.getMethod("emptyCall"), args); assertEquals(args[0], processedArgs[0]); assertEquals(args[1], processedArgs[1]); assertEquals(2, processedArgs.length); }