@Test
public void testGetMethod() throws ReflectiveOperationException {

    ServiceExample instance = new ServiceExample();
    Method m = ReflectionUtils
        .getMethod(
            Thread.currentThread().getContextClassLoader(),
            ServiceExample.class,
            "primitiveType",
            Arrays.asList("String", "Integer"));
    assertEquals(Integer.valueOf(2), m.invoke(instance, "pepe", 2));
    m = ReflectionUtils
        .getMethod(
            Thread.currentThread().getContextClassLoader(),
            ServiceExample.class,
            "primitiveType",
            Arrays.asList("String", "Float"));
    assertEquals(Float.valueOf(2.0f), m.invoke(instance, "pepe", 2.0f));
}