// Path: mock4aj-core/src/main/java/info/rubico/mock4aj/Mock4AspectJ.java
// public final class Mock4AspectJ {
// 
//     private static final WeavedProxyFactory DEFAULT_PROXY_FACTORY = new CglibWeavedProxyFactory();
//     private static final Weaver DEFAULT_WEAVER = new AspectJWeaver();
// 
//     private static WeavedProxyFacade weavedProxyFacade;
// 
//     static {
//         weavedProxyFacade = new WeavedProxyFacade(DEFAULT_PROXY_FACTORY, DEFAULT_WEAVER);
//     }
// 
//     private Mock4AspectJ() {
//     }
// 
//     public static synchronized <T> T createWeavedProxy(T objectToProxy,
//                                                        Class<?>... aspectsToWeave) {
//         return weavedProxyFacade.createWeavedProxy(objectToProxy, aspectsToWeave);
//     }
// 
//     public static synchronized <T> T call(T objectToCall, CallContext callContext) {
//         return new CglibCallWeavingSimulator().call(objectToCall, callContext);
//     }
// 
//     public static synchronized CallContext callContext() {
//         DEFAULT_WEAVER.reset();
//         return new DefaultCallContextWithExistingWeaver(DEFAULT_WEAVER);
//     }
// 
//     public static synchronized FictitiousSource fakeSourceClass(String name) {
//         return new FictitiousSource(name);
//     }
// }
// 
// Path: mock4aj-acceptancetests/src/main/java/info/rubico/mock4aj/acceptance/testdata/Target.java
// public interface Target {
// 
//     void theMethod();
// 
//     void otherMethod();
// 
//     int retInt();
// 
//     void throwingMethod() throws SomeException;
// 
//     void markWeaved(Class<?> fromAspect);
// }


import static info.rubico.mock4aj.Mock4AspectJ.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import info.rubico.mock4aj.acceptance.testdata.Target;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.SuppressAjWarnings;
import org.junit.Before;
import org.junit.Test;
        proxy.otherName();

        assertEquals(1, AspectUnderTest.someDoTimes);
        assertEquals(0, AspectUnderTest.targetPlusTimes);
        assertEquals(0, AspectUnderTest.withinTargetTimes);
        assertEquals(0, AspectUnderTest.exactTargetTimes);
        assertEquals(0, AspectUnderTest.thisTargetTimes);
    }

    @Test
    public void usingAMockCombiningTarget() {
        Target targetMockedPlusHoneypot = mock(Target.class,
                                               withSettings().extraInterfaces(Honeypot.class));
        Honeypot proxy = (Honeypot) createWeavedProxy(targetMockedPlusHoneypot,
                                                      AspectUnderTest.class);

        proxy.doX(0);
        proxy.doXNoArgs();
        proxy.otherName();

        assertEquals(1, AspectUnderTest.someDoTimes);
        assertEquals(1, AspectUnderTest.targetPlusTimes);
        assertEquals(1, AspectUnderTest.withinTargetTimes);
        assertEquals(1, AspectUnderTest.thisTargetTimes);
        assertEquals(0, AspectUnderTest.exactTargetTimes);
    }

    // CHECKSTYLE:OFF
    // @formatter:off

// Path: mock4aj-core/src/main/java/info/rubico/mock4aj/Mock4AspectJ.java
// public final class Mock4AspectJ {
// 
//     private static final WeavedProxyFactory DEFAULT_PROXY_FACTORY = new CglibWeavedProxyFactory();
//     private static final Weaver DEFAULT_WEAVER = new AspectJWeaver();
// 
//     private static WeavedProxyFacade weavedProxyFacade;
// 
//     static {
//         weavedProxyFacade = new WeavedProxyFacade(DEFAULT_PROXY_FACTORY, DEFAULT_WEAVER);
//     }
// 
//     private Mock4AspectJ() {
//     }
// 
//     public static synchronized <T> T createWeavedProxy(T objectToProxy,
//                                                        Class<?>... aspectsToWeave) {
//         return weavedProxyFacade.createWeavedProxy(objectToProxy, aspectsToWeave);
//     }
// 
//     public static synchronized <T> T call(T objectToCall, CallContext callContext) {
//         return new CglibCallWeavingSimulator().call(objectToCall, callContext);
//     }
// 
//     public static synchronized CallContext callContext() {
//         DEFAULT_WEAVER.reset();
//         return new DefaultCallContextWithExistingWeaver(DEFAULT_WEAVER);
//     }
// 
//     public static synchronized FictitiousSource fakeSourceClass(String name) {
//         return new FictitiousSource(name);
//     }
// }
// 
// Path: mock4aj-acceptancetests/src/main/java/info/rubico/mock4aj/acceptance/testdata/Target.java
// public interface Target {
// 
//     void theMethod();
// 
//     void otherMethod();
// 
//     int retInt();
// 
//     void throwingMethod() throws SomeException;
// 
//     void markWeaved(Class<?> fromAspect);
// }


// Path: mock4aj-acceptancetests/src/test/java/info/rubico/mock4aj/acceptance/VerifyBehaviorOnPossibleMethodExecutionUsingInterfacesAccTest.java
import static info.rubico.mock4aj.Mock4AspectJ.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import info.rubico.mock4aj.acceptance.testdata.Target;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.SuppressAjWarnings;
import org.junit.Before;
import org.junit.Test;

        proxy.otherName();

        assertEquals(1, AspectUnderTest.someDoTimes);
        assertEquals(0, AspectUnderTest.targetPlusTimes);
        assertEquals(0, AspectUnderTest.withinTargetTimes);
        assertEquals(0, AspectUnderTest.exactTargetTimes);
        assertEquals(0, AspectUnderTest.thisTargetTimes);
    }

    @Test
    public void usingAMockCombiningTarget() {
        Target targetMockedPlusHoneypot = mock(Target.class,
                                               withSettings().extraInterfaces(Honeypot.class));
        Honeypot proxy = (Honeypot) createWeavedProxy(targetMockedPlusHoneypot,
                                                      AspectUnderTest.class);

        proxy.doX(0);
        proxy.doXNoArgs();
        proxy.otherName();

        assertEquals(1, AspectUnderTest.someDoTimes);
        assertEquals(1, AspectUnderTest.targetPlusTimes);
        assertEquals(1, AspectUnderTest.withinTargetTimes);
        assertEquals(1, AspectUnderTest.thisTargetTimes);
        assertEquals(0, AspectUnderTest.exactTargetTimes);
    }

    // CHECKSTYLE:OFF
    // @formatter:off

    public interface ExtendedHoneypot extends Target {