@Test
public void testGetFactoryMethod() throws Exception {

    ServiceContext serviceContext = ServiceContextManager.getServiceContext(getClass().getClassLoader());
    PropertyConverterManager manager = new PropertyConverterManager(serviceContext, false);
    Method getFactoryMethod = PropertyConverterManager.class.getDeclaredMethod("getFactoryMethod", new Class[]{Class.class, String[].class});
    getFactoryMethod.setAccessible(true);
    Method foundMethod = (Method) getFactoryMethod.invoke(manager, MyType.class, new String[]{"instanceOf"});
    assertThat(foundMethod.getName()).isEqualTo("instanceOf");
    
    Method staticOf = (Method) getFactoryMethod.invoke(manager, MyType.class, new String[]{"of"});
    assertThat(staticOf.getName()).isEqualTo("of");
    Method notFoundMethod = (Method) getFactoryMethod.invoke(manager, MyType.class, new String[]{"missingMethod"});
    assertThat(notFoundMethod).isNull();
    Method wrongSignature = (Method) getFactoryMethod.invoke(manager, MyType.class, new String[]{"getValue"});
    assertThat(wrongSignature).isNull();
}