### Question:
SoapClientHandler implements SoapClientHandlerInterface<T> { @Override public Method getSoapClientMethod(T soapClient, Method method) throws NoSuchMethodException { for (Method soapClientMethod : soapClient.getClass().getMethods()) { if (method.getName().equals(soapClientMethod.getName()) && method.getReturnType().equals(soapClientMethod.getReturnType())) { return soapClientMethod; } } throw new NoSuchMethodException("No method named " + method.getName() + " with return type " + method.getReturnType() + " found."); } protected  SoapClientHandler(); @Override Method getSoapClientMethod(T soapClient, Method method);  }### Answer:
@Test public void testGetSoapClientMethod() throws Exception { Method method = soapClientHandler.getSoapClientMethod(soapClient, SimilarMockSoapClient.class.getMethod( "identityCall", Object[].class, Object.class, Object.class)); assertEquals(MockSoapClient.class.getMethod("identityCall", Object[].class), method); }
@Test public void testGetSoapClientMethod_noMethod() throws Exception { thrown.expect(NoSuchMethodException.class); soapClientHandler.getSoapClientMethod(soapClient, SimilarMockSoapClient.class.getMethod( "noSuchMethod", Object[].class, Object.class, Object.class)); }
@Test public void testGetSoapClientMethod_incorrectReturnType() throws Exception { thrown.expect(NoSuchMethodException.class); soapClientHandler.getSoapClientMethod(soapClient, SimilarMockSoapClient.class.getMethod("voidCall", Object[].class)); }