KarafMBeanServerGuard testGuard = EasyMock.createMock(KarafMBeanServerGuard.class);
String objectName = "foo.bar.testing:type=SomeMBean";
final String[] la = new String[]{"long"};
final String[] sa = new String[]{"java.lang.String"};
EasyMock.expect(testGuard.canInvoke(EasyMock.eq(mbs), EasyMock.eq(new ObjectName(objectName)), EasyMock.eq("testMethod"), EasyMock.aryEq(la))).andReturn(true).anyTimes();
EasyMock.expect(testGuard.canInvoke(EasyMock.eq(mbs), EasyMock.eq(new ObjectName(objectName)), EasyMock.eq("testMethod"), EasyMock.aryEq(sa))).andReturn(false).anyTimes();
EasyMock.expect(testGuard.canInvoke(EasyMock.eq(mbs), EasyMock.eq(new ObjectName(objectName)), EasyMock.eq("otherMethod"))).andReturn(true).anyTimes();
String objectName2 = "foo.bar.testing:type=SomeOtherMBean";
EasyMock.expect(testGuard.canInvoke(EasyMock.eq(mbs), EasyMock.eq(new ObjectName(objectName2)))).andReturn(true).anyTimes();
String objectName3 = "foo.bar.foo.testing:type=SomeOtherMBean";