import javax.xml.bind.*;
import java.util.Map;

public class Test7 {
    private static JAXBContext tmp;

    public static abstract class FactoryBase implements JAXBContextFactory {
        @Override
        public JAXBContext createContext(Class<?>[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
            return tmp;
        }

        @Override
        public JAXBContext createContext(String contextPath, ClassLoader classLoader, Map<String, ?> properties)
                throws JAXBException {
            return tmp;
        }
    }

    public static class Factory extends FactoryBase {}

    public static void main(String[] args) throws JAXBException {
        tmp = JAXBContext.newInstance(Test7.class);
        System.setProperty(JAXBContext.JAXB_CONTEXT_FACTORY, "Test7$Factory");
        JAXBContext.newInstance(Test7.class);
    }
}