[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\n(A clear and concise description of what the bug is.)\n\n**To Reproduce**\n\n(Please provide a public github repo with a full SFDX project that demonstrates the problem. If the repro case can be followed with a single example Apex class against a scratch org with just the fflib-apex-mocks project deployed into it, you don't need to provide a github repo)\n\nSteps to reproduce the behavior:\n1. Create a scratch org as follows....\n2. Run the following Anonymous Apex....\n3. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots and text of error observed**\nIf applicable, add screenshots to help explain your problem. Also, paste the text of the raw error into the issue as well so that it can be found by others via search.\n\n**Version**\nDid you try to reproduce the problem against the latest fflib-apex-mocks code?\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/workflows/deploy.and.test.yml",
    "content": "name: Create a Scratch Org, Push Source and Run Apex Tests\n\non:\n  push:\n  pull_request_target:\n  workflow_dispatch:\n\njobs:\n  build:\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2 #Check out this repo\n        with:\n          ref: ${{github.event.pull_request.head.ref}}\n          repository: ${{github.event.pull_request.head.repo.full_name}}\n      - name: Install SF CLI and authorize DevHub\n        uses: apex-enterprise-patterns/setup-sfdx@v2 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety\n        with:\n          sfdx-auth-url: ${{ secrets.DEVHUB_SFDXURL }}\n      - name: Setup the config parameters needed\n        run: sf config set target-dev-hub SFDX-ENV --global #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here\n      - name: Create the scratch org\n        run: sf org create scratch --definition-file config/project-scratch-def.json --set-default --duration-days 1 --no-track-source\n      - name: Deploy and compile the codebase\n        run: sf project deploy start\n      - name: Run the core framework tests\n        run: sf apex run test --wait 5\n      - name: Destroy scratch org\n        run: sf org delete scratch --no-prompt\n        if: always()\n"
  },
  {
    "path": ".github/workflows/manage.sf.api.versions.yml",
    "content": "name: Manage SF API Versions\non:\n  workflow_dispatch:\n    inputs:\n      api-version:\n        description: 'api version in the format XX e.g 58'\n        required: true\n        type: string\njobs:\n  update:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: apex-enterprise-patterns/manage-sf-api-version@v1.0.0\n        with:\n          api-version: ${{inputs.api-version}}\n      - uses: peter-evans/create-pull-request@v5\n        with:\n          title: 'Bump API Versions to ${{inputs.api-version}}.0'\n          body: 'Automatically bumped by GitHub Actions '\n          branch: 'devops/bump-api-versions-v${{inputs.api-version}}.0'\n          commit-message: 'chore: bump api to v${{inputs.api-version}}.0'\n"
  },
  {
    "path": ".gitignore",
    "content": "# General Project related\n.DS_Store\ntarget/\ntemp/\n/deploy/*\n/debug/\n**/dep-dir.txt\n*.prefs\nbuild.properties\n/sfdx-source/apex-mocks/main/default\n\n# MavensMate IDE related\n*mm.log\n*.sublime-build\n*.sublime-project\n*.sublime-settings\n*.sublime-workspace\n.sublime-project\n.tm_properties\n\n# Eclipse IDE Related\n.project\n.settings/\nsalesforce.schema\nReferenced Packages/\n\n# VS Code IDE Related\n.vscode/\n.history/\n\n# Illuminated Cloud Related\n.idea/\nIlluminatedCloud\n\n# SFDX Related\n.sfdx/\n.sf/\nsfdx-source/untracked/\n.execanon\n\n# NPM Related\npackage.json\n/node_modules\npackage-lock.json\n\n\nsfdx-source/group*\nresearch/\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c), FinancialForce.com, inc\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, \n   are permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, \n    this list of conditions and the following disclaimer.\n- Redistributions in binary form must reproduce the above copyright notice, \n    this list of conditions and the following disclaimer in the documentation \n    and/or other materials provided with the distribution.\n- Neither the name of the FinancialForce.com, inc nor the names of its contributors \n    may be used to endorse or promote products derived from this software without \n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES \nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL \nTHE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\nOR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\nOF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "# FFLib ApexMocks Framework\n\n![Push Source and Run Apex Tests](https://github.com/apex-enterprise-patterns/fflib-apex-mocks/workflows/Create%20a%20Scratch%20Org,%20Push%20Source%20and%20Run%20Apex%20Tests/badge.svg)\n\nApexMocks is a mocking framework for the Salesforce Lightning Apex language. \n\nIt derives its inspiration from the well known Java mocking framework [Mockito](https://site.mockito.org/)\n\n<a href=\"https://githubsfdeploy.herokuapp.com?owner=apex-enterprise-patterns&repo=fflib-apex-mocks\">\n  <img alt=\"Deploy to Salesforce\"\n\t   src=\"https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png\">\n</a>\n\n## Using ApexMocks on the Salesforce Lightning Platform\n\nApexMocks allows you to write tests to both verify behavior and stub dependencies.\n\nAn assumption is made that you are using some form of [Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection) - for example passing dependencies via a constructor:\n```Java\npublic MyClass(ClassA.IClassA dependencyA, ClassB.IClassB dependencyB)\n```\nThis allows you to pass mock implementations of dependencies A and B when you want to unit test MyClass.\n\nLets assume we've written our own list interface fflib_MyList.IList that we want to either verify or stub:\n```Java\npublic class fflib_MyList implements IList\n{\n\tpublic interface IList\n\t{\n\t\tvoid add(String value);\n\t\tString get(Integer index);\n\t\tvoid clear();\n\t\tBoolean isEmpty();\n\t}\n}\n```\n### verify() behaviour verification\n```Java\n// Given\nfflib_ApexMocks mocks = new fflib_ApexMocks();\nfflib_MyList.IList mockList = (fflib_MyList.IList)mocks.mock(fflib_MyList.class);\n\n// When\nmockList.add('bob');\n\n// Then\n((fflib_MyList.IList) mocks.verify(mockList)).add('bob');\n((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).clear();\n```\n\nIf the method wasn't called the expected number of times, or with the expected arguments, verify will throw an exception.\nThe exception message contains details of the expected and actual invocations:\n\n```\nEXPECTED COUNT: 1\nACTUAL COUNT: 0\nMETHOD: EmailService__sfdc_ApexStub.sendTo(String)\n---\nACTUAL ARGS: (\"user-two@example.com\")\n---\nEXPECTED ARGS: [[contains \"user-one\"]]\n\n```\n\n### when() dependency stubbing\n```Java\nfflib_ApexMocks mocks = new fflib_ApexMocks();\nfflib_MyList.IList mockList = (fflib_MyList.IList)mocks.mock(fflib_MyList.class);\n\nmocks.startStubbing();\nmocks.when(mockList.get(0)).thenReturn('bob');\nmocks.when(mockList.get(1)).thenReturn('fred');\nmocks.stopStubbing();\n```\n\n## Utilties\n\n### Setting a read-only field, such as a formula\n\n```Java\nAccount acc = new Account();\nInteger mockFormulaResult = 10;\nacc = (Account)fflib_ApexMocksUtils.setReadOnlyFields(\n\t\tacc,\n\t\tAccount.class,\n\t\tnew Map<SObjectField, Object> {Account.Your_Formula_Field__c => mockFormulaResult}\n);\nSystem.assertEquals(mockFormulaResult, acc.Your_Formula_Field__c);\n```\n\n## Stub API\nUsing Salesforce's [Stub API](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_stub_api.htm), stub objects are generated dynamically at run time.\n```Java\nfflib_ApexMocks mocks = new fflib_ApexMocks();\nfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n```\n\n## Documentation\n\n* [ApexMocks Framework Tutorial](http://code4cloud.wordpress.com/2014/05/06/apexmocks-framework-tutorial/)\n* [Simple Dependency Injection](http://code4cloud.wordpress.com/2014/05/09/simple-dependency-injection/)\n* [ApexMocks Generator](http://code4cloud.wordpress.com/2014/05/15/using-apex-mocks-generator-to-create-mock-class-definitions/)\n* [Behaviour Verification](http://code4cloud.wordpress.com/2014/05/15/writing-behaviour-verification-unit-tests/)\n* [Stubbing Dependencies](http://code4cloud.wordpress.com/2014/05/15/stubbing-dependencies-in-a-unit-test/)\n* [Supported Features](http://code4cloud.wordpress.com/2014/05/15/apexmocks-supported-features/)\n* [New Improved apex-mocks-generator](http://code4cloud.wordpress.com/2014/06/27/new-improved-apex-mocks-generator/)\n* [ApexMocks Improvements - exception stubbing, base classes and more](http://code4cloud.wordpress.com/2014/11/05/apexmocks-improvements-exception-stubbing-inner-interfaces-and-mock-base-classes/)\n* [Matchers](http://superdupercode.blogspot.co.uk/2016/03/apex-mocks-matchers.html)\n* [ApexMock blogs from Jesse Altman](http://jessealtman.com/tag/apexmocks/)\n* [Order of calls verification](https://xonoxforce.wordpress.com/2017/03/26/inorder-verify/)\n* [Answering](https://xonoxforce.wordpress.com/2017/03/31/answering-with-apex-mocks/)\n* [Counters](https://xonoxforce.wordpress.com/2017/04/01/counters-in-apex-mocks-verifications/)\n* [Troubleshooting](https://salesforce.stackexchange.com/questions/252460/my-apexmocks-arent-working-what-could-be-wrong)\n"
  },
  {
    "path": "config/project-scratch-def.json",
    "content": "{\n    \"orgName\": \"apex-mocks\",\n    \"edition\": \"Developer\",\n    \"settings\": {\n        \"lightningExperienceSettings\": {\n            \"enableS1DesktopEnabled\": true\n        }\n    }\n}\n"
  },
  {
    "path": "sfdx-project.json",
    "content": "{\n  \"packageDirectories\": [\n    {\n      \"path\": \"sfdx-source/apex-mocks\",\n      \"default\": true\n    }\n  ],\n  \"namespace\": \"\",\n  \"sfdcLoginUrl\": \"https://login.salesforce.com\",\n  \"sourceApiVersion\": \"63.0\"\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_Answer.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n *\tInterface for the answering framework.\n *\tThis interface must be implemented inside the test class and implement the call back method answer.\n *\t@group Core\n */\n@NamespaceAccessible\npublic interface fflib_Answer\n{\n\t/**\n\t *\tMethod to be implemented in the test class to implement the call back method.\n\t *\t@param invocation The invocation on the mock.\n\t *\t@throws The exception to be thrown.\n\t *\t@return The value to be returned.\n\t */\n\tObject answer(fflib_InvocationOnMock invocation);\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_Answer.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_AnyOrder.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n *\t'Classic' invocation verifier - checks that a method was called with the given arguments the expected number of times.\n *\tThe order of method calls is not important.\n *\t@group Core\n */\n@NamespaceAccessible\npublic class fflib_AnyOrder extends fflib_MethodVerifier\n{\n\t/*\n\t * Verifies a method was invoked the expected number of times, with the expected arguments.\n\t * @param qualifiedMethod The method to be verified.\n\t * @param methodArg The arguments of the method that needs to be verified.\n\t * @param verificationMode The verification mode that holds the setting about how the verification should be performed.\n\t */\n\tprotected override void verify(\n\t\tfflib_QualifiedMethod qm,\n\t\tfflib_MethodArgValues expectedArguments,\n\t\tfflib_VerificationMode verificationMode)\n\t{\n\t\tList<fflib_IMatcher> expectedMatchers = fflib_Match.Matching ? fflib_Match.getAndClearMatchers(expectedArguments.argValues.size()) : null;\n\t\tList<fflib_MethodArgValues> actualArguments = fflib_MethodCountRecorder.getMethodArgumentsByTypeName().get(qm);\n\n\t\tInteger methodCount = getMethodCount(expectedArguments, expectedMatchers, actualArguments);\n\n\t\tString qualifier = '';\n\t\tInteger expectedCount = null;\n\n\t\tif((verificationMode.VerifyMin == verificationMode.VerifyMax) && methodCount != verificationMode.VerifyMin)\n\t\t{\n\t\t\texpectedCount = verificationMode.VerifyMin;\n\t\t}\n\t\telse if (verificationMode.VerifyMin != null && verificationMode.VerifyMin > methodCount)\n\t\t{\n\t\t\texpectedCount = verificationMode.VerifyMin;\n\t\t\tqualifier = ' or more times';\n\t\t}\n\t\telse if (verificationMode.VerifyMax != null && verificationMode.VerifyMax < methodCount)\n\t\t{\n\t\t\texpectedCount = verificationMode.VerifyMax;\n\t\t\tqualifier = ' or fewer times';\n\t\t}\n\n\t\tif (expectedCount != null)\n\t\t{\n\t\t\tthrowException(qm, '', expectedCount, qualifier, methodCount, verificationMode.CustomAssertMessage, expectedArguments, expectedMatchers, actualArguments);\n\t\t}\n\t}\n\n\tprivate Integer getMethodCount(fflib_MethodArgValues methodArg, List<fflib_IMatcher> matchers, List<fflib_MethodArgValues> methodArgs)\n\t{\n\t\tInteger retval = 0;\n\n\t\tif (methodArgs != null)\n\t\t{\n\t\t\tif (matchers != null)\n\t\t\t{\n\t\t\t\tfor (fflib_MethodArgValues args : methodArgs)\n\t\t\t\t{\n\t\t\t\t\tif (fflib_Match.matchesAllArgs(args, matchers))\n\t\t\t\t\t{\n\t\t\t\t\t\tcapture(matchers);\n\t\t\t\t\t\tretval ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn countCalls(methodArgs, methodArg);\n\t\t\t}\n\t\t}\n\n\t\treturn retval;\n\t}\n\n\tprivate Integer countCalls(List<fflib_MethodArgValues> methodArgs, fflib_MethodArgValues methodArg)\n\t{\n\t\tInteger count = 0;\n\n\t\tfor(fflib_MethodArgValues arg: methodArgs)\n\t\t{\n\t\t\tif( arg == methodArg) count++;\n\t\t}\n\n\t\treturn count;\n\t}\n\n\t/*\n\t * Method that validate the verification mode used in the verify.\n\t * Not all the methods from the fflib_VerificationMode are implemented for the different classes that extends the fflib_MethodVerifier.\n\t * The error is thrown at run time, so this method is called in the method that actually performs the verify.\n\t * @param verificationMode The verification mode that have to been verified.\n\t * @throws Exception with message for the fflib_VerificationMode not implemented.\n\t */\n\tprotected override void validateMode(fflib_VerificationMode verificationMode)\n\t{\n\t\tif(verificationMode.Method == fflib_VerificationMode.ModeName.CALLS)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n\t\t\t\t'The calls() method is available only in the InOrder Verification.');\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_AnyOrder.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ApexMocks.cls",
    "content": "/*\n Copyright (c) 2014-2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_ApexMocks implements System.StubProvider\n{\n\tpublic static final Integer NEVER = 0;\n\n\tprivate final fflib_MethodCountRecorder methodCountRecorder;\n\tprivate final fflib_MethodReturnValueRecorder methodReturnValueRecorder;\n\n\tprivate fflib_MethodVerifier methodVerifier;\n\tprivate fflib_VerificationMode verificationMode;\n\tprivate fflib_Answer myAnswer;\n\n\tpublic Boolean verifying { get; set; }\n\n\tpublic Boolean Stubbing\n\t{\n\t\tget\n\t\t{\n\t\t\treturn methodReturnValueRecorder.Stubbing;\n\t\t}\n\n\t\tprivate set;\n\t}\n\n\tpublic List<Exception> DoThrowWhenExceptions\n\t{\n\t\tget\n\t\t{\n\t\t\treturn methodReturnValueRecorder.DoThrowWhenExceptions;\n\t\t}\n\n\t\tset\n\t\t{\n\t\t\tmethodReturnValueRecorder.DoThrowWhenExceptions = value;\n\t\t}\n\t}\n\n\t/**\n\t * Construct an ApexMocks instance.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_ApexMocks()\n\t{\n\t\tthis.verifying = false;\n\n\t\tthis.methodCountRecorder = new fflib_MethodCountRecorder();\n\t\tthis.verificationMode = new fflib_VerificationMode();\n\t\tthis.methodVerifier = new fflib_AnyOrder();\n\n\t\tthis.methodReturnValueRecorder = new fflib_MethodReturnValueRecorder();\n\n\t\tthis.methodReturnValueRecorder.Stubbing = false;\n\t}\n\n\t/**\n     * Creates mock object of given class or interface.\n     * @param classToMock class or interface to mock.\n     * @return mock object.\n     */\n\t@NamespaceAccessible\n\tpublic Object mock(Type classToMock)\n\t{\n\t\treturn Test.createStub(classToMock, this);\n\t}\n\n\t/**\n\t * Inherited from StubProvider.\n\t * @param stubbedObject The stubbed object.\n\t * @param stubbedMethodName The name of the invoked method.\n\t * @param returnType The return type of the invoked method.\n\t * @param listOfParamTypes A list of the parameter types of the invoked method.\n\t * @param listOfParamNames A list of the parameter names of the invoked method.\n\t * @param listOfArgs The actual argument values passed into this method at runtime.\n\t * @return The stubbed return value. Null by default, unless you prepared one that matches this method and argument values in stubbing.\n\t */\n\t@NamespaceAccessible\n\tpublic Object handleMethodCall(Object stubbedObject, String stubbedMethodName, Type returnType,\n\t\tList<type> listOfParamTypes, List<String> listOfParamNames, List<Object> listOfArgs)\n    {\n        return mockNonVoidMethod(stubbedObject, stubbedMethodName, listOfParamTypes, listOfArgs);\n    }\n\n\t@NamespaceAccessible\n\tpublic static String extractTypeName(Object mockInstance)\n\t{\n\t\treturn String.valueOf(mockInstance).split(':').get(0);\n\t}\n\n\t/**\n\t * Verify a method was called on a mock object.\n\t * @param mockInstance The mock object instance.\n\t * @return The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object verify(Object mockInstance)\n\t{\n\t\treturn verify(mockInstance, this.times(1));\n\t}\n\n\t/**\n\t * Verify a method was called on a mock object.\n\t * @param mockInstance The mock object instance.\n\t * @param verificationMode Defines the constraints for performing the verification (e.g. the minimum and maximum expected invocation counts).\n\t * @return The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object verify(Object mockInstance, fflib_VerificationMode verificationMode)\n\t{\n\t\tthis.verifying = true;\n\t\tthis.verificationMode = verificationMode;\n\n\t\treturn mockInstance;\n\t}\n\n\t/**\n\t * Verify a method was called on a mock object.\n\t * @param mockInstance The mock object instance.\n\t * @param times The number of times you expect the method to have been called.\n\t * @return The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object verify(Object mockInstance, Integer times)\n\t{\n\t\treturn verify(mockInstance, this.times(times));\n\t}\n\n\t/**\n\t * Verfiy a method was called on a mock object.\n\t * @param mockInvocation The invocation on the mock containing information about the method and the arguments.\n\t */\n\tpublic void verifyMethodCall(fflib_InvocationOnMock mockInvocation)\n\t{\n\t\tthis.methodVerifier.verifyMethodCall(mockInvocation, verificationMode);\n\t\tthis.methodVerifier = new fflib_AnyOrder();\n\n\t\tthis.verifying = false;\n\t}\n\n\t/**\n\t * Tell ApexMocks framework you are about to start stubbing using when() calls.\n\t */\n\t@NamespaceAccessible\n\tpublic void startStubbing()\n\t{\n\t\tmethodReturnValueRecorder.Stubbing = true;\n\t}\n\n\t/**\n\t * Tell ApexMocks framework you are about to stop stubbing using when() calls.\n\t */\n\t@NamespaceAccessible\n\tpublic void stopStubbing()\n\t{\n\t\tmethodReturnValueRecorder.Stubbing = false;\n\t}\n\n\t/**\n\t * Setup when stubbing for a mock object instance.\n\t * @param ignoredRetVal This is the return value from the method called on the mockInstance, and is ignored here since we are about to setup\n\t *        the stubbed return value using thenReturn() (see MethodReturnValue class below).\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodReturnValue when(Object ignoredRetVal)\n\t{\n\t\treturn methodReturnValueRecorder.MethodReturnValue;\n\t}\n\n\t/**\n\t * Record a method was called on a mock object.\n\t * @param mockInvocation The invocation on the mock containing information about the method and the arguments.\n\t */\n\tpublic void recordMethod(fflib_InvocationOnMock mockInvocation)\n\t{\n\t\tmethodCountRecorder.recordMethod(mockInvocation);\n\t}\n\n\t/**\n\t * Prepare a stubbed method return value.\n\t * @param mockInvocation The invocation on the mock containing information about the method and the arguments.\n\t * @return The MethodReturnValue instance.\n\t */\n\tpublic fflib_MethodReturnValue prepareMethodReturnValue(fflib_InvocationOnMock mockInvocation)\n\t{\n\t\treturn methodReturnValueRecorder.prepareMethodReturnValue(mockInvocation);\n\t}\n\n\t/**\n\t * Get the method return value for the given method call.\n\t * @param mockInvocation The invocation on the mock containing information about the method and the arguments.\n\t * @return The MethodReturnValue instance.\n\t */\n\tpublic fflib_MethodReturnValue getMethodReturnValue(fflib_InvocationOnMock mockInvocation)\n\t{\n\t\treturn methodReturnValueRecorder.getMethodReturnValue(mockInvocation);\n\t}\n\n\t/**\n\t * Setup exception stubbing for a void method.\n\t * @param e The exception to throw.\n\t * @param mockInstance The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object doThrowWhen(Exception e, Object mockInstance)\n\t{\n\t\tmethodReturnValueRecorder.prepareDoThrowWhenExceptions(new List<Exception>{e});\n\t\treturn mockInstance;\n\t}\n\n\t/**\n\t * Setup exception stubbing for a void method.\n\t * @param exps The list of exceptions to throw.\n\t * @param mockInstance The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object doThrowWhen(List<Exception> exps, Object mockInstance)\n\t{\n\t\tmethodReturnValueRecorder.prepareDoThrowWhenExceptions(exps);\n\t\treturn mockInstance;\n\t}\n\n\t/**\n\t * Setup answer stubbing for a void method.\n\t * @param answer The answer to invoke.\n\t * @param mockInstance The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object doAnswer(fflib_Answer answer, Object mockInstance)\n\t{\n\t\tthis.myAnswer = answer;\n\t\treturn mockInstance;\n\t}\n\n\t/**\n\t * Mock a void method. Called by generated mock instance classes, not directly by a developers\n\t * code.\n\t * @param mockInstance The mock object instance.\n\t * @param methodName The method for which to prepare a return value.\n\t * @param methodArgTypes The method argument types for which to prepare a return value.\n\t * @param methodArgValues The method argument values for which to prepare a return value.\n\t */\n\tpublic void mockVoidMethod(Object mockInstance, String methodName, List<Type> methodArgTypes, List<Object> methodArgValues)\n\t{\n\t\tmockNonVoidMethod(mockInstance, methodName, methodArgTypes, methodArgValues);\n\t}\n\n\t/**\n\t * Mock a non-void method. Called by generated mock instance classes, not directly by a developers\n\t * code.\n\t * @param mockInstance The mock object instance.\n\t * @param methodName The method for which to prepare a return value.\n\t * @param methodArgTypes The method argument types for which to prepare a return value.\n\t * @param methodArgValues The method argument values for which to prepare a return value.\n\t */\n\tpublic Object mockNonVoidMethod(Object mockInstance, String methodName, List<Type> methodArgTypes, List<Object> methodArgValues)\n\t{\n\t\tfflib_QualifiedMethod qm = new fflib_QualifiedMethod(extractTypeName(mockInstance), methodName, methodArgTypes, mockInstance);\n\t\tfflib_MethodArgValues argValues = new fflib_MethodArgValues(methodArgValues);\n\n\t\tfflib_InvocationOnMock invocation = new fflib_InvocationOnMock(qm, argValues, mockInstance);\n\n\t\tif (this.verifying)\n\t\t{\n\t\t\tverifyMethodCall(invocation);\n\t\t}\n\t\telse if (Stubbing)\n\t\t{\n\t\t\tfflib_MethodReturnValue methotReturnValue = prepareMethodReturnValue(invocation);\n\n\t\t\tif(DoThrowWhenExceptions != null)\n\t\t\t{\n\t\t\t\tmethotReturnValue.thenThrowMulti(DoThrowWhenExceptions);\n\t\t\t\tDoThrowWhenExceptions = null;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif(this.myAnswer != null)\n\t\t\t{\n\t\t\t\tmethotReturnValue.thenAnswer(this.myAnswer);\n\t\t\t\tthis.myAnswer = null;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trecordMethod(invocation);\n\t\t\treturn returnValue(invocation);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Custom exception class for ApexMocks\n\t */\n\t@NamespaceAccessible\n\tpublic class ApexMocksException extends Exception\n\t{\n\n\t}\n\n\tprivate Object returnValue(fflib_InvocationOnMock invocation)\n\t{\n\t\tfflib_MethodReturnValue methodReturnValue = getMethodReturnValue(invocation);\n\n\t\tif (methodReturnValue != null)\n\t\t{\n\t\t\tif(methodReturnValue.Answer == null)\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n  \t\t\t\t\t'The stubbing is not correct, no return values have been set.');\n\t\t\t}\n\n\t\t\tObject returnedValue = methodReturnValue.Answer.answer(invocation);\n\n\t\t\tif(returnedValue == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (returnedValue instanceof Exception)\n\t\t\t{\n\t\t\t\tthrow ((Exception) returnedValue);\n\t\t\t}\n\n\t\t\treturn returnedValue;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Sets how many times the method is expected to be called.\n\t * For InOrder verification we copy Mockito behavior which is as follows;\n\t * <ul>\n\t * <li>Consume the specified number of matching invocations, ignoring non-matching invocations in between</li>\n\t * <li>Fail an assert if the very next invocation matches, but additional matches can still exist so long as at least one non-matching invocation exists before them</li>\n\t * </ul>\n\t * For example if you had a(); a(); b(); a();\n\t * then inOrder.verify(myMock, 2)).a(); or inOrder.verify(myMock, 3)).a(); would pass but not inOrder.verify(myMock, 1)).a();\n\t * @param times The number of times you expect the method to have been called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode times(Integer times)\n\t{\n\t\treturn new fflib_VerificationMode().times(times);\n\t}\n\n\t/**\n\t * Sets how many times the method is expected to be called for an InOrder verifier. Available Only with the InOrder verification.\n\t * A verification mode using calls will not fail if the method is called more times than expected.\n\t * @param times The number of times you expect the method to have been called in the InOrder verifying ( no greedy verify).\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode calls(Integer times)\n\t{\n\t\treturn new fflib_VerificationMode().calls(times);\n\t}\n\n\t/**\n\t * Sets a custom assert message for the verify.\n\t * @param customAssertMessage The custom message for the assert in case the assert is false. The custom message is queued to the default message.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode description(String customAssertMessage)\n\t{\n\t\treturn new fflib_VerificationMode().description(customAssertMessage);\n\t}\n\n\t/**\n\t * Sets the minimum number of times the method is expected to be called.\n\t * With the InOrder verification it performs a greedy verification, which means it would consume all the instances of the method verified.\n\t * @param atLeastTimes The minimum number of times you expect the method to have been called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode atLeast(Integer atLeastTimes)\n\t{\n\t\treturn new fflib_VerificationMode().atLeast(atLeastTimes);\n\t}\n\n\t/**\n\t * Sets the maximum number of times the method is expected to be called. Not available in the InOrder verification.\n\t * @param atMostTimes The maximum number of times the method is expected to be called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode atMost(Integer atMostTimes)\n\t{\n\t\treturn new fflib_VerificationMode().atMost(atMostTimes);\n\t}\n\n\t/**\n\t * Sets that the method is called at least once.\n\t * With the InOrder verification it performs a greedy verification, which means it would consume all the instances of the method verified.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode atLeastOnce()\n\t{\n\t\treturn new fflib_VerificationMode().atLeastOnce();\n\t}\n\n\t/**\n\t * Sets the range of how many times the method is expected to be called. Not available in the InOrder verification.\n\t * @param atLeastTimes The minimum number of times you expect the method to have been called.\n\t * @param atMostTimes The maximum number of times the method is expected to be called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode between(Integer atLeastTimes, Integer atMostTimes)\n\t{\n\t\treturn new fflib_VerificationMode().between(atLeastTimes, atMostTimes);\n\t}\n\n\t/**\n\t * Sets that the method is not expected to be called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode never()\n\t{\n\t\treturn new fflib_VerificationMode().never();\n\t}\n\n\t/**\n\t * Sets the fflib_VerificationMode object.\n\t * To internal use only.\n\t * Used to pass the verification mode that has been set in the  verify of the fflib_InOrder class.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\tpublic void setOrderedVerifier(fflib_InOrder verifyOrderingMode)\n\t{\n\t\tthis.methodVerifier = verifyOrderingMode;\n\t}\n\t\n\t/**\n\t * A simple override to suppress the default toString logic, which is noisy and rarely useful.\n\t * In some cases, the Salesforce default implementation of toString here can cause internal Salesforce errors\n\t * if it has circular references.\n\t * @return \"fflib_ApexMocks\" String literal\n\t */\n\tpublic override String toString()\n\t{\n\t\treturn 'fflib_ApexMocks';\n\t}\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ApexMocks.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ApexMocksConfig.cls",
    "content": "/*\n * Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n@IsTest\n@NamespaceAccessible\npublic class fflib_ApexMocksConfig\n{\n\t/**\n\t * When false, stubbed behaviour and invocation counts are shared among all test spies.\n\t * - See fflib_ApexMocksTest.thatMultipleInstancesCanBeMockedDependently\n\t * - This is the default for backwards compatibility.\n\t * When true, each test spy instance has its own stubbed behaviour and invocations.\n\t * - See fflib_ApexMocksTest.thatMultipleInstancesCanBeMockedIndependently\n\t */\n\t@NamespaceAccessible\n\tpublic static Boolean HasIndependentMocks {get; set;}\n\n\tstatic\n\t{\n\t\tHasIndependentMocks = false;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ApexMocksConfig.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ApexMocksUtils.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@NamespaceAccessible\npublic class fflib_ApexMocksUtils\n{\n\t/**\n\t * This is taken from https://gist.github.com/afawcett/8dbfc0e1d8c43c982881.\n\t *\n\t * This method works on the principle that serializing and deserialising child records is supported\n\t *\n\t *   System.assertEquals(1, ((List<Master__c>) \n\t *    JSON.deserialize(\n\t *\t    JSON.serialize(\n\t *         [select Id, Name, \n\t *            (select Id, Name from Children__r) from Master__c]), List<Master__c>.class))\n\t *               [0].Children__r.size());\n\t *\n\t * This method results internally in constructing this JSON, before deserialising it back into SObject's\n\t *\n\t *\t\t[\n\t *\t\t    {\n\t *\t\t        \"attributes\": {\n\t *\t\t            \"type\": \"Master__c\",\n\t *\t\t            \"url\": \"/services/data/v32.0/sobjects/Master__c/a0YG0000005Jn5uMAC\"\n\t *\t\t        },\n\t *\t\t        \"Name\": \"Fred\",\n\t *\t\t        \"Id\": \"a0YG0000005Jn5uMAC\",\n\t *\t\t        \"Children__r\": {\n\t *\t\t            \"totalSize\": 1,\n\t *\t\t            \"done\": true,\n\t *\t\t            \"records\": [\n\t *\t\t                {\n\t *\t\t                    \"attributes\": {\n\t *\t\t                        \"type\": \"Child__c\",\n\t *\t\t                        \"url\": \"/services/data/v32.0/sobjects/Child__c/a0ZG0000006JGPAMA4\"\n\t *\t\t                    },\n\t *\t\t                    \"Name\": \"Bob\",\n\t *\t\t                    \"Id\": \"a0ZG0000006JGPAMA4\",\n\t *\t\t                    \"Master__c\": \"a0YG0000005Jn5uMAC\"\n\t *\t\t                }\n\t *\t\t            ]\n\t *\t\t        }\n\t * \t\t]\n\t */\n\tpublic static Object makeRelationship(Type parentsType, List<SObject> parents, SObjectField relationshipField, List<List<SObject>> children) {\n\n\t\t// Find out more about this relationship...\n\t\tString relationshipFieldName = relationshipField.getDescribe().getName();\n\t\tDescribeSObjectResult parentDescribe = parents.getSObjectType().getDescribe();\n\t\treturn deserializeParentsAndChildren(parentsType, parentDescribe, relationshipField, parents, children);\n\t}\n\n\t/**\n\t * Generic overload to makeRelationship. Enables creation of\n\t * relationships in a loosely-coupled manner. \n\t */\n\t@NamespaceAccessible\n\tpublic static Object makeRelationship(\n\t\t\tString parentTypeName,\n\t\t\tString childTypeName,\n\t\t\tList<SObject> parents,\n\t\t\tString relationshipFieldName,\n\t\t\tList<List<SObject>> children) {\n\n\t\t// Find out more about this relationship...\n\t\tSObjectType parentType = getType(parentTypeName);\n\t\tSObjectField relationshipField = getField(childTypeName, relationshipFieldName);\n\t\tDescribeSObjectResult parentDescribe = parentType.getDescribe();\n\t\tType parentsType = List<SObject>.class;\n\t\treturn deserializeParentsAndChildren(parentsType, parentDescribe, relationshipField, parents, children);\n\t}\n\n\t/**\n\t * Gives the ability to set test values on formula\n\t * and other read-only fields of mock SObjects\n\t */\n\t@NamespaceAccessible\n\tpublic static Object setReadOnlyFields(SObject objInstance, Type deserializeType, Map<SObjectField, Object> properties) {\n\n\t\tMap<String, Object> fieldNameMap = new Map<String, Object>();\n\t\tfor (SObjectField field : properties.keySet()) {\n\t\t\t// Resolve the fieldNames from the FieldTokens\n\t\t\tfieldNameMap.put(field.getDescribe().getName(), properties.get(field));\n\t\t}\n\t\treturn (SObject) setReadOnlyFields(objInstance, deserializeType, fieldNameMap);\n\t}\n\n\t/**\n\t * Generic overload to setReadOnlyFields. Enables setting test\n\t * values on read-only fields by their name\n\t */\n\t@NamespaceAccessible\n\tpublic static Object setReadOnlyFields(SObject objInstance, Type deserializeType, Map<String, Object> properties) {\n\n\t\tMap<String, Object> mergedMap = new Map<String, Object>(objInstance.getPopulatedFieldsAsMap());\n\t\t// Merge the values from the properties map into the fields already set on the object\n\t\tmergedMap.putAll(properties);\n\t\t// Serialize the merged map, and then deserialize it as the desired object type.\n\t\tString jsonString = JSON.serializePretty(mergedMap);\n\t\treturn (SObject) JSON.deserialize(jsonString, deserializeType);\n\t}\n\n\t/**\n\t * Helper Methods\n\t */\n\tprivate static Object deserializeParentsAndChildren(\n\t\tType parentsType,\n\t\tDescribeSObjectResult parentDescribe,\n\t\tSObjectField relationshipField,\n\t\tList<SObject> parents,\n\t\tList<List<SObject>> children\n\t) {\n\t\tList<Schema.ChildRelationship> childRelationships = parentDescribe.getChildRelationships();\n\n\t\tString relationshipName = null;\n\t\tfor(Schema.ChildRelationship childRelationship : childRelationships) {\n\t\t\tif(childRelationship.getField() == relationshipField) {\n\t\t\t\trelationshipName = childRelationship.getRelationshipName();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Stream the parsed JSON representation of the parent objects back out, injecting children as it goes\n\t\tJSONParser parentsParser = JSON.createParser(JSON.serialize(parents));\n\t\tJSONParser childrenParser = JSON.createParser(JSON.serialize(children));\n\t\tJSONGenerator combinedOutput = JSON.createGenerator(false);\t\t\n\t\tstreamTokens(parentsParser, combinedOutput, new InjectChildrenEventHandler(childrenParser, relationshipName, children) );\n\n\t\t// Derserialise back into SObject list complete with children\n\t\treturn JSON.deserialize(combinedOutput.getAsString(), parentsType);\n\t}\n\n\t/**\n\t * Monitors stream events for end of object for each SObject contained in the parent list\n\t *   then injects the respective childs record list into the stream\n\t */\n\tprivate class InjectChildrenEventHandler implements JSONParserEvents\n\t{\n\t\tprivate JSONParser childrenParser;\n\t\tprivate String relationshipName;\n\t\tprivate List<List<SObject>> children;\n\t\tprivate Integer childListIdx = 0;\n\n\t\tpublic InjectChildrenEventHandler(JSONParser childrenParser, String relationshipName, List<List<SObject>> children) {\n\t\t\tthis.childrenParser = childrenParser;\n\t\t\tthis.relationshipName = relationshipName;\n\t\t\tthis.children = children;\n\t\t\tthis.childrenParser.nextToken(); // Consume the outer array token\n\t\t}\n\n\t\tpublic void nextToken(JSONParser fromStream, Integer depth, JSONGenerator toStream) {\n\t\t\t// Inject children?\n\t\t\tJSONToken currentToken = fromStream.getCurrentToken();\n\t\t\tif(depth == 2 && currentToken == JSONToken.END_OBJECT ) {\n\t\t\t\ttoStream.writeFieldName(relationshipName);\n\t\t\t\ttoStream.writeStartObject();\n\t\t\t\ttoStream.writeNumberField('totalSize', children[childListIdx].size());\n\t\t\t\ttoStream.writeBooleanField('done', true);\n\t\t\t\ttoStream.writeFieldName('records');\n\t\t\t\tstreamTokens(childrenParser, toStream, null);\n\t\t\t\ttoStream.writeEndObject();\n\t\t\t\tchildListIdx++;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Utility function to stream tokens from a reader to a write, while providing a basic eventing model\n\t */\n\tprivate static void streamTokens(JSONParser fromStream, JSONGenerator toStream, JSONParserEvents events)\n\t{\n\t\tInteger depth = 0;\n\t\twhile (fromStream.nextToken() != null)\n\t\t{\n\t\t\t// Give event handler chance to inject\n\t\t\tif (events != null) {\n\t\t\t\tevents.nextToken(fromStream, depth, toStream);\n\t\t\t}\n\t\t\t\t\n\t\t\t// Forward to output stream\n\t\t\tswitch on fromStream.getCurrentToken() {\n\t\t\t\twhen START_ARRAY {\n\t\t\t\t\ttoStream.writeStartArray();\n\t\t\t\t\tdepth++;\n\t\t\t\t}\n\t\t\t\twhen START_OBJECT {\n\t\t\t\t\ttoStream.writeStartObject();\n\t\t\t\t\tdepth++;\n\t\t\t\t}\n\t\t\t\twhen FIELD_NAME {\n\t\t\t\t\ttoStream.writeFieldName(fromStream.getCurrentName());\n\t\t\t\t}\n\t\t\t\twhen VALUE_STRING, VALUE_FALSE, VALUE_TRUE, VALUE_NUMBER_FLOAT, VALUE_NUMBER_INT {\n\t\t\t\t\ttoStream.writeString(fromStream.getText());\n\t\t\t\t}\n\t\t\t    when VALUE_NULL {\n\t\t\t\t\ttoStream.writeNull();\n\t\t\t\t}\n\t\t\t\twhen END_OBJECT {\n\t\t\t\t\ttoStream.writeEndObject();\n\t\t\t\t\tdepth--;\n\t\t\t\t}\n\t\t\t\twhen END_ARRAY {\n\t\t\t\t\ttoStream.writeEndArray();\n\t\t\t\t\tdepth--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Don't continue to stream beyond the initial starting point\n\t\t\tif (depth == 0) \n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Basic event used during the above streaming\n\t */\n\tprivate interface JSONParserEvents\n\t{\n\t\tvoid nextToken(JSONParser fromStream, Integer depth, JSONGenerator toStream);\n\t}\n\n\t/**\n\t * Gets the SObjectType by name\n\t */\n\tprivate static Schema.SObjectType getType(String typeName) {\n\t\tMap<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();\n\t\tSObjectType sobjType = gd.get(typeName);\n\t\tif (sobjType == null) {\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('SObject type not found: ' + typeName);\n\t\t}\n\t\treturn sobjType;\n\t}\n\n\t/**\n\t * Gets the SObjectField of an object by name\n\t */\n\tprivate static Schema.SObjectField getField(String objectName, String fieldName) {\n\n\t\tSObjectType sobjType = getType(objectName);\n\t\tMap<String, Schema.SObjectField> objectFields = sobjType.getDescribe().fields.getMap();\n\t\tSchema.SObjectField sobjField = objectFields.get(fieldName);\n\t\tif (sobjField == null) {\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('SObject field not found: ' + fieldName);\n\t\t}\n\t\treturn sobjField;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ApexMocksUtils.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ArgumentCaptor.cls",
    "content": "/*\n * Copyright (c) 2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * \tThis class implements the capturing framework for ApexMocks\n *\tAccording to Mockito's syntax the type is passed in the capturer construction,\n *\thowever Apex cannot perform the auto casting that Java can.\n *\tTo be consistent with Mockito, the capturer does not perform any checks on the type of the argument.\n * \t@group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_ArgumentCaptor\n{\n\tprotected List<Object> argumentsCaptured = new List<Object>();\n\n\t/**\n\t *\tFactory method to create a new fflib_ArgumentCaptor.\n\t * \tTakes the captured argument's Type for consistency with Mockito syntax.\n\t * \tThe Type is IGNORED because we can't determine an object instance's Type at runtime unlike in Java.\n\t *\tRigorous type checking may be introduced in a future release, so you should specify the expected argument type correctly.\n\t *\n\t * \t@param \tignoredCaptureType Type (class) of the captured argument\n\t * \t@return A new fflib_ArgumentCaptor.\n\t */\n\t@NamespaceAccessible\n\tpublic static fflib_ArgumentCaptor forClass(Type ignoredCaptureType)\n\t{\n\t\treturn new fflib_ArgumentCaptor();\n\t}\n\n\t/**\n\t *\tUse it to capture the argument. This method must be used inside verification.\n\t *\tInternally, this method registers a special implementation of a Matcher.\n\t * \tThis argument matcher stores the argument value so that you can use it later to perform assertions.\n\t *\n\t * \t@return a special matcher that matches any argument and remembers the value.\n\t */\n\t@NamespaceAccessible\n\tpublic Object capture()\n\t{\n\t\tAnyObject myMatcher = new AnyObject(this);\n\n\t\treturn fflib_Match.matches(myMatcher);\n\t}\n\n\t/**\n\t *\tReturns the captured value of the argument. When capturing all arguments use getAllValues().\n\t *\tIf verified method was called multiple times then this method returns the latest captured value.\n\t *\n\t * \t@return\tcaptured argument value.\n\t */\n\t@NamespaceAccessible\n\tpublic Object getValue()\n\t{\n\t\tif( argumentsCaptured == null ||\n\t\t\targumentsCaptured.size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t//returns the last argument called\n\t\treturn argumentsCaptured.get( argumentsCaptured.size() - 1 );\n\t}\n\n\t/**\n\t *\tReturns all captured values. Use it when capturing multiple arguments or when the verified method was called multiple times.\n\t *\tWhen capturing multiple arguments is called multiple times, this method returns a merged list of all values from all invocations.\n\t *\n\t * \t@return\tReturns all captured values. Use it when capturing multiple arguments on the same call or when the verified method was called multiple times.\n\t */\n\t@NamespaceAccessible\n\tpublic List<Object> getAllValues()\n\t{\n\t\treturn argumentsCaptured;\n\t}\n\n\t@NamespaceAccessible\n\tpublic class AnyObject implements fflib_IMatcher\n\t{\n\t\tprivate fflib_ArgumentCaptor captor;\n\t\tprivate Object value;\n\n\t\tpublic AnyObject(fflib_ArgumentCaptor captor)\n\t\t{\n\t\t\tthis.captor = captor;\n\t\t}\n\n\t\t//match with all the possible values and store the arg value\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tvalue = arg;\n\t\t\treturn true;\n\t\t}\n\n\t\t//store the argument in the list ( this would be called inside the method counter where is compared with the matchers of the method)\n\t\tpublic void storeArgument()\n\t\t{\n\t\t\tcaptor.argumentsCaptured.add(value);\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_ArgumentCaptor.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_IDGenerator.cls",
    "content": "/**\n * Copyright (c) 2014, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@NamespaceAccessible\npublic with sharing class fflib_IDGenerator\n{\n\tprivate static Integer fakeIdCount = 0;\n\tprivate static final String ID_PATTERN = '000000000000';\n\n\t/**\n\t * Generate a fake Salesforce Id for the given SObjectType\n\t */\n\t@NamespaceAccessible\n\tpublic static Id generate(Schema.SObjectType sobjectType)\n\t{\n\t\tString keyPrefix = sobjectType.getDescribe().getKeyPrefix();\n\t\tfakeIdCount++;\n\n\t\tString fakeIdPrefix = ID_PATTERN.substring(0, ID_PATTERN.length() - String.valueOf(fakeIdCount).length());\n\n\t\treturn Id.valueOf(keyPrefix + fakeIdPrefix + fakeIdCount);\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_IDGenerator.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_IMatcher.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@NamespaceAccessible\npublic interface fflib_IMatcher\n{\n\t/**\n\t * Whether or not the supplied argument is a match.\n\t * Any supplementary information (e.g. boundary conditions, objects to match to etc)\n\t * should be cached by the matcher constructor.\n\t * @param arg The argument value supplied to the method\n\t * @return Boolean True if the argument value is a match, false otherwise.\n\t */\n\tBoolean matches(Object arg);\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_IMatcher.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_InOrder.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n\n/**\n * @group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_InOrder extends fflib_MethodVerifier\n{\n\tprivate final List<Object> unorderedMockInstances;\n\tprivate Integer idxMethodCall = 0;\n\n\tprivate Set<fflib_VerificationMode.ModeName> notImplementedMethods =\n\t\tnew Set<fflib_VerificationMode.ModeName>\n\t\t{\n\t\t\tfflib_VerificationMode.ModeName.atMost,\n\t\t\tfflib_VerificationMode.ModeName.between\n\t\t};\n\n\tprivate final fflib_ApexMocks mocks;\n\n\t/**\n\t * Construct the InOrder instance.\n\t * @param mocks The apex mock object instance.\n\t * @param unorderedMockInstances One or more mock implementation classes (listed in any order), whose ordered method calls require verification.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_InOrder(fflib_ApexMocks mocks, List<Object> unorderedMockInstances)\n\t{\n\t\tthis.unorderedMockInstances = unorderedMockInstances;\n\t\tthis.mocks = mocks;\n\t}\n\n\t/**\n\t * Verify a method was called on a mock object.\n\t * It performs a no strict ordered verification.\n\t * The verification could be either greedy or not depending of the verificationMode passed.\n\t * Check the fflib_VerificationMode methods for details.\n\t * @param mockInstance The mock object instance.\n\t * @param verificationMode Defines the constraints for performing the verification (e.g. the minimum and maximum expected invocation counts).\n\t * @return The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object verify(Object mockInstance, fflib_VerificationMode verificationMode)\n\t{\n\t\tmocks.setOrderedVerifier(this);\n\t\treturn mocks.verify(mockInstance, verificationMode);\n\t}\n\n\t/**\n\t * Verify a method was called on a mock object.\n\t * It performs the default times(1) verification for the InOrder.\n\t * @param mockInstance The mock object instance.\n\t * @return The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object verify(Object mockInstance)\n\t{\n\t\tmocks.setOrderedVerifier(this);\n\t\treturn mocks.verify(mockInstance);\n\t}\n\n\t/**\n\t * Verify a method was called on a mock object.\n\t * Wrapper for the new syntax call to be conformed to the old style notation\n\t * It performs the equivalent of times(times) verification for the InOrder.\n\t * @param mockInstance The mock object instance.\n\t * @param times The number of times you expect the method to have been called.\n\t * @return The mock object instance.\n\t */\n\t@NamespaceAccessible\n\tpublic Object verify(Object mockInstance, Integer times)\n\t{\n\t\tmocks.setOrderedVerifier(this);\n\t\treturn mocks.verify(mockInstance, times);\n\t}\n\n\t/**\n\t * Verify that after the last successful verified method no more interactions happened on the inOrderMock instance.\n\t * @throws Exception with message to help to identify the last method called.\n\t */\n\t@NamespaceAccessible\n\tpublic void verifyNoMoreInteractions()\n\t{\n\t\tif(idxMethodCall == 0)\n\t\t{\n\t\t\tverifyNoInteractions();\n\t\t}\n\n\t\tif(hasNextInteraction(unorderedMockInstances, idxMethodCall))\n\t\t{\n\t\t\tfflib_InvocationOnMock invocation =\n\t\t\t\tfflib_MethodCountRecorder.getOrderedMethodCalls().get(idxMethodCall -1);\n\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n\t\t\t\t'No more Interactions were expected after the ' + invocation.getMethod() +' method.');\n\t\t}\n\t}\n\n\t/**\n\t * Verify that no interactions at all happened on the inOrderMock instance.\n\t * @throws Exception with message.\n\t */\n\t@NamespaceAccessible\n\tpublic void verifyNoInteractions()\n\t{\n\t\tif(hasNextInteraction(unorderedMockInstances, 0))\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n\t\t\t\t'No Interactions expected on this InOrder Mock instance!');\n\t\t}\n\t}\n\n\t/*\n\t * Verifies a method was invoked the expected number of times, with the expected arguments.\n\t * The in-order verifier remembers the last method invocation it successfully verified,\n\t * and only considers subsequent method invocations for subsequent verifications.\n\t * @param qualifiedMethod The method to be verified.\n\t * @param expectedArguments The arguments of the method that needs to be verified.\n\t * @param verificationMode The verification mode that holds the setting about how the verification should be performed.\n\t */\n\tprotected override void verify(\n\t\tfflib_QualifiedMethod qm,\n\t\tfflib_MethodArgValues expectedArguments,\n\t\tfflib_VerificationMode verificationMode)\n\t{\n\t\tString inOrder = ' in order';\n\t\tList<fflib_IMatcher> matchers = fflib_Match.Matching ? fflib_Match.getAndClearMatchers(expectedArguments.argValues.size()) : null;\n\t\tList<fflib_InvocationOnMock> actualInvocations = fflib_MethodCountRecorder.getOrderedMethodCalls();\n\t\tList<fflib_MethodArgValues> actualArguments = new List<fflib_MethodArgValues>();\n\t\tfor (fflib_InvocationOnMock invocation : actualInvocations)\n\t\t{\n\t\t\tactualArguments.add(invocation.getMethodArgValues());\n\t\t}\n\n\t\tif( verificationMode.VerifyMin == 0 && verificationMode.VerifyMax == 0)\n\t\t{\n\t\t\tInteger methodCounts = countInteractions(matchers, qm, expectedArguments);\n\t\t\tif(methodCounts != 0 )\n\t\t\t\tthrowException(qm, inOrder, fflib_ApexMocks.NEVER, '', methodCounts, verificationMode.CustomAssertMessage, expectedArguments, matchers, actualArguments);\n\t\t}\n\n\t\tInteger i=0;\n\t\tfor ( ; i<verificationMode.VerifyMin; i++ )\n\t\t{\n\t\t\tif(!verifyMethodCalled(matchers, qm, expectedArguments))\n\t\t\t{\n\t\t\t\tthrowException(qm, inOrder, verificationMode.VerifyMin, '', i, verificationMode.CustomAssertMessage, expectedArguments, matchers, actualArguments);\n\t\t\t}\n\t\t}\n\n\t\tif( verificationMode.VerifyMin == verificationMode.VerifyMax )\n\t\t{\n\t\t\tif(hasNextInteraction(unorderedMockInstances, idxMethodCall))\n\t\t\t{\n\t\t\t\tfflib_InvocationOnMock nextMethod = getNextMethodCall(false);\n\n\t\t\t\tif(nextMethod.getMethod() == qm &&\n\t\t\t\t\targumentsMatch(nextMethod.getMethodArgValues(), matchers, expectedArguments))\n\t\t\t\t{\n\t\t\t\t\tInteger methodCounts = i + countInteractions(matchers, qm, expectedArguments);\n\t\t\t\t\tthrowException(qm, inOrder, verificationMode.VerifyMin, '', methodCounts, verificationMode.CustomAssertMessage, expectedArguments, matchers, actualArguments);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t//consuming all the calls in case is the atLeast or atLeastOnce method\n\t\tif(verificationMode.Method == fflib_VerificationMode.ModeName.atLeast\n\t\t\t|| verificationMode.Method == fflib_VerificationMode.ModeName.atLeastOnce)\n\t\t{\n\t\t\tconsumeInteractions(matchers, qm, expectedArguments);\n\t\t}\n\t}\n\n\tprivate Boolean verifyMethodCalled(\n\t\tList<fflib_IMatcher> matchers,\n\t\tfflib_QualifiedMethod qm,\n\t\tfflib_MethodArgValues methodArg)\n\t{\n\t\tfflib_InvocationOnMock calledMethod = getNextMethodCall();\n\t\twhile(calledMethod != null)\n\t\t{\n\t\t\tif(calledMethod.getMethod() == qm &&\n\t\t\t\targumentsMatch(calledMethod.getMethodArgValues(), matchers, methodArg))\n\t\t\t{\n\t\t\t\t//it's our method\n\t\t\t\tif (matchers != null)\n\t\t\t\t{\n\t\t\t\t\tcapture(matchers);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcalledMethod = getNextMethodCall();\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate Integer countInteractions(\n\t\tList<fflib_IMatcher> matchers,\n\t\tfflib_QualifiedMethod qualifiedMethod,\n\t\tfflib_MethodArgValues methodArg)\n\t{\n\t\tInteger interactionsCouter = 0;\n\n\t\tfor (Integer i = idxMethodCall, len = fflib_MethodCountRecorder.getOrderedMethodCalls().size(); i<len; i++)\n\t\t{\n\t\t\tfflib_InvocationOnMock invocation = fflib_MethodCountRecorder.getOrderedMethodCalls().get(i);\n\t\t\tfor (Object mockInstance : unorderedMockInstances)\n\t\t\t{\n\t\t\t\tif (invocation.getMock() === mockInstance\n\t\t\t\t\t&& (qualifiedMethod == invocation.getMethod())\n\t\t\t\t\t&& (argumentsMatch(invocation.getMethodArgValues(), matchers, methodArg)))\n\t\t\t\t{\n\t\t\t\t\tinteractionsCouter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn interactionsCouter;\n\t}\n\n\tprivate void consumeInteractions(\n\t\tList<fflib_IMatcher> matchers,\n\t\tfflib_QualifiedMethod qualifiedMethod,\n\t\tfflib_MethodArgValues methodArg)\n\t{\n\t\tInteger lastInteracionIndex = 0;\n\n\t\t//going all through the orderedMethodCalls to find all the interaction of the method\n\t\tfor (Integer i = idxMethodCall, len = fflib_MethodCountRecorder.getOrderedMethodCalls().size(); i<len; i++)\n\t\t{\n\t\t\tfflib_InvocationOnMock invocation = fflib_MethodCountRecorder.getOrderedMethodCalls().get(i);\n\t\t\tfor (Object mockInstance : unorderedMockInstances)\n\t\t\t{\n\t\t\t\tif (invocation.getMock() === mockInstance\n\t\t\t\t\t&& (qualifiedMethod == invocation.getMethod())\n\t\t\t\t\t&& (argumentsMatch(invocation.getMethodArgValues(), matchers, methodArg)))\n\t\t\t\t{\n\t\t\t\t\t//it's our method\n\t\t\t\t\tlastInteracionIndex = i;\n\t\t\t\t\tif (matchers != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcapture(matchers);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//now we can move the index to our last call\n\t\tidxMethodCall = lastInteracionIndex + 1;\n\t}\n\n\tprivate Boolean argumentsMatch(\n\t\tfflib_MethodArgValues calledMethodArg,\n\t\tList<fflib_IMatcher> matchers,\n\t\tfflib_MethodArgValues methodArg)\n\t{\n\t\t//Check it was called with the right args.\n\t\tif (matchers != null)\n\t\t{\n\t\t\tif(fflib_Match.matchesAllArgs(calledMethodArg, matchers))\n\t\t\t{\n\t\t\t\t//Return now we've matched the method call\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse if(calledMethodArg == methodArg)\n\t\t{\n\t\t\t//Return now we've matched the method call\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate fflib_InvocationOnMock getNextMethodCall()\n\t{\n\t\treturn getNextMethodCall(true);\n\t}\n\n\tprivate fflib_InvocationOnMock getNextMethodCall(Boolean updateIdxMethodCall)\n\t{\n\t\tInteger idx = 0;\n\t\tfor (fflib_InvocationOnMock invocation : fflib_MethodCountRecorder.getOrderedMethodCalls())\n\t\t{\n\t\t\tif (idx == idxMethodCall)\n\t\t\t{\n\t\t\t\tif(isForMockInstance(invocation))\n\t\t\t\t{\n\t\t\t\t\tif(updateIdxMethodCall)\n\t\t\t\t\t\tidxMethodCall++;\n\t\t\t\t\treturn invocation;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tidx++;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate Boolean isForMockInstance(fflib_InvocationOnMock invocation)\n\t{\n\t\tfor (Object mi : unorderedMockInstances)\n\t\t{\n\t\t\tif (mi === invocation.getMock())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/*\n\t * Used by the fflib_InOrder invocation verifier to find further interactions with a given mock instances.\n\t * @param mockInstances The tracked mock instances - only methods called on these objects are counted as an invocation.\n\t * @param idxLastMethodCalled The index of the last matched method, used to offset the search for invocations so we don't double count invocations.\n\t * @return Whether or not there were further interactions.\n\t */\n\tprivate Boolean hasNextInteraction(List<Object> mockInstances, Integer idxLastMethodCalled)\n\t{\n\t\tInteger idx = 0;\n\n\t\tfor (fflib_InvocationOnMock methodCall : fflib_MethodCountRecorder.getOrderedMethodCalls())\n\t\t{\n\t\t\tif (isForMockInstance(methodCall))\n\t\t\t{\n\t\t\t\tidx++;\n\t\t\t\tif (idx > idxLastMethodCalled)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/*\n\t * Method that validate the verification mode used in the verify.\n\t * Not all the methods from the fflib_VerificationMode are implemented for the different classes that extends the fflib_MethodVerifier.\n\t * The error is thrown at run time, so this method is called in the method that actually performs the verify.\n\t * @param verificationMode The verification mode that have to been verified.\n\t * @throws Exception with message for the fflib_VerificationMode not implemented.\n\t */\n\tprotected override void validateMode(fflib_VerificationMode verificationMode)\n\t{\n\t\tif(notImplementedMethods.contains(verificationMode.Method))\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n\t\t\t\t'The ' + verificationMode.Method.name() + ' method is not implemented for the fflib_InOrder class');\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_InOrder.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_Inheritor.cls",
    "content": "/*\n * Copyright (c) 2016-2017 FinancialForce.com, inc.  All rights reserved.\n */\n@isTest\n@NamespaceAccessible\npublic class fflib_Inheritor implements IA, IB, IC\n{\n\tpublic interface IA {String doA();}\n    public interface IB {String doB();}\n    public interface IC {String doC();}\n    \n    public String doA(){return 'Did A';}\n    public String doB(){return 'Did B';}\n    public String doC(){return 'Did C';}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_Inheritor.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_InvocationOnMock.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n *\tAn invocation on a mock.\n *\tA place holder for mock, the method that was called and the arguments that were passed.\n *\t@group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_InvocationOnMock\n{\n\tprivate fflib_QualifiedMethod qm;\n\tprivate fflib_MethodArgValues methodArg;\n\tprivate Object mockInstance;\n\n\t/**\n\t *\tConstructor for the class.\n\t *  @param qm The fflib_QualifiedMethod instance to be stored.\n\t *  @param args The fflib_MethodArgValues instance to be stored.\n\t *  @param mockInstance The mock instance to be stored.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_InvocationOnMock(fflib_QualifiedMethod qm, fflib_MethodArgValues args, Object mockInstance)\n\t{\n\t\tthis.qm = qm;\n\t\tthis.methodArg = args;\n\t\tthis.mockInstance = mockInstance;\n\t}\n\n\t/**\n\t *\tReturns the argument at the given index.\n\t *  @param index The index of the wanted argument.\n\t *  @throws ApexMocksException in case the index is out of range.\n\t *  @return The argument at the given index.\n\t */\n\t@NamespaceAccessible\n\tpublic Object getArgument(Integer index)\n\t{\n\t\tvalidateIndex(index);\n\t\treturn methodArg.argValues[index];\n\t}\n\n\t/**\n\t *\tReturns the list of arguments passed to the method.\n\t *  @return The list of arguments.\n\t */\n\t@NamespaceAccessible\n\tpublic List<Object> getArguments()\n\t{\n\t\treturn methodArg.argValues;\n\t}\n\n\t/**\n\t *\tReturns fflib_MethodArgValues instance that represents the arguments passed to the method.\n\t *  @return The fflib_MethodArgValues instance that represents the arguments passed to the method.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodArgValues getMethodArgValues()\n\t{\n\t\treturn methodArg;\n\t}\n\n\t/**\n\t *\tReturns the fflib_QualifiedMethod instance that represent the fully qualified method called within the invocation.\n\t *\t@return The method stored in the invocation.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_QualifiedMethod getMethod()\n\t{\n\t\treturn qm;\n\t}\n\n\t/**\n\t *\tReturns the mock object on which the invocation occurs.\n\t *\t@return The mock object on which the invocation occurs.\n\t */\n\t@NamespaceAccessible\n\tpublic Object getMock()\n\t{\n\t\treturn mockInstance;\n\t}\n\n\tprivate void validateIndex(Integer index)\n\t{\n\t\tif(index < 0 || index >= methodArg.argValues.size())\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Invalid index, must be greater or equal to zero and less of ' + methodArg.argValues.size()+'.');\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_InvocationOnMock.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_Match.cls",
    "content": "/**\n * Copyright (c) 2014, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@NamespaceAccessible\npublic class fflib_Match\n{\n\tprivate static List<fflib_IMatcher> matchers = new List<fflib_IMatcher>();\n\n\t/** \n\t * Matching\n\t * True when comparing method arg values to matchers, false when comparing absolute arg values.\n\t */\n\tpublic static Boolean Matching = false;\n\t\n\t/**\n\t * Used internally by the mocking framework, you shouldn't need to call this method directly.\n\t * Copies the registered matchers, and then switches matching mode off.\n\t * @param expectedSize The expected number of matchers to be returned. If this does not match the actual value an expection is thrown.\n\t * @return List<fflib_IMatcher> The registered matchers, collected while in matching mode.\n\t */\n\t@NamespaceAccessible\n\tpublic static List<fflib_IMatcher> getAndClearMatchers(Integer expectedSize)\n\t{\n\t\tMatching = false;\n\n\t\tList<fflib_IMatcher> retval = matchers.clone();\n\t\tmatchers.clear();\n\n\t\tif (retval.size() != expectedSize)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('The number of matchers defined (' + retval.size() + ').'\n\t\t\t\t+ ' does not match the number expected (' + expectedSize + ')\\n'\n\t\t\t\t+ 'If you are using matchers all arguments must be passed in as matchers.\\n'\n\t\t\t\t+ 'For example myList.add(fflib_Match.anyInteger(), \\'String\\') should be defined as myList.add(fflib_Match.anyInteger(), fflib_Match.eq(\\'String\\')).');\n\t\t}\n\t\t\n\t\treturn retval;\n\t}\n\t\n\t/**\n\t * Used internally by the mocking framework, you shouldn't need to call this method directly.\n\t * Compares all supplied method arg values to the supplied target matchers.\n\t * @param methodArg The arguments supplied when the method was called\n\t * @param targetMatchers The matchers the arguments need to be compared with\n\t * @throws fflib_ApexMocks.ApexMocksException Thrown when methodArgValues is null/empty, targetMatchers is null, or their sizes don't match\n\t * @return Boolean True if all arg values satisfy all of the supplied matchers.\n\t */\n\t@NamespaceAccessible\n\tpublic static Boolean matchesAllArgs(fflib_MethodArgValues methodArg, List<fflib_IMatcher> targetMatchers)\n\t{\n\t\tvalidateArgs(methodArg, targetMatchers);\n\t\t\n\t\tInteger matchersSize = targetMatchers.size();\n\t\tfor (Integer i=0; i<matchersSize; i++)\n\t\t{\n\t\t\tObject argValue = methodArg.argValues[i];\n\t\t\tfflib_IMatcher matcher = targetMatchers[i];\n\t\t\t\n\t\t\tif (!matcher.matches(argValue))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}\n\t\n\tprivate static void validateArgs(fflib_MethodArgValues methodArg, List<fflib_IMatcher> targetMatchers)\n\t{\n\t\tif (methodArg == null)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('MethodArgs cannot be null');\n\t\t}\n\t\t\n\t\tif (methodArg.argValues == null)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('MethodArgs.argValues cannot be null');\n\t\t}\n\t\t\n\t\tif (targetMatchers == null)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Matchers cannot be null');\n\t\t}\n\t\t\n\t\tif (targetMatchers.size() != methodArg.argValues.size())\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('MethodArgs and matchers must have the same count'\n\t\t\t\t+ ', MethodArgs: (' + methodArg.argValues.size() + ') ' + methodArg.argValues\n\t\t\t\t+ ', Matchers: (' + targetMatchers.size() + ') ' + targetMatchers);\n\t\t}\n\t}\n\t\n\t/**\n\t * Registers a matcher which will be stubbed/verified against.\n\t * @param matcher The matcher that needs to be compared\n\t * @return Object Always returns null. This can then be cast into the correct arg type\n\t * so that the right method is called on the mock objects.\n\t */\n\t@NamespaceAccessible\n\tpublic static Object matches(fflib_IMatcher matcher)\n\t{\n\t\tMatching = true;\n\t\tmatchers.add(matcher);\n\t\t\n\t\treturn null;\n\t}\n\t\n\t/** \n\t * COMBINED MATCHER\n\t * The allOf, anyOf and noneOf methods are overloaded to provide fluent matcher calls for up to 4 matcher conditions.\n\t * To connect 5 or more, the List<Object> version directly.\n\t */\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches allOf\n\t * @param o1 A dummy object returned by registering another matcher \n\t * @param o2 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)public static Object allOf(Object o1, Object o2)\n\t */\n    public static Object allOf(Object o1, Object o2)\n\t{\n\t\treturn allOf(new Object[]{ o1, o2 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches allOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @param o3 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object allOf(Object o1, Object o2, Object o3)\n\t{\n\t\treturn allOf(new Object[]{ o1, o2, o3 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches allOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @param o3 A dummy object returned by registering another matcher\n\t * @param o4 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object allOf(Object o1, Object o2, Object o3, Object o4)\n\t{\n\t\treturn allOf(new Object[]{ o1, o2, o3, o4 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches allOf\n\t * @param o A list of dummy objects returned by registering other matchers\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object allOf(List<Object> o)\n\t{\n\t\treturn combined(fflib_MatcherDefinitions.Connective.ALL, o);\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object anyOf(Object o1, Object o2)\n\t{\n\t\treturn anyOf(new Object[]{ o1, o2 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @param o3 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object anyOf(Object o1, Object o2, Object o3)\n\t{\n\t\treturn anyOf(new Object[]{ o1, o2, o3 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @param o3 A dummy object returned by registering another matcher\n\t * @param o4 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object anyOf(Object o1, Object o2, Object o3, Object o4)\n\t{\n\t\treturn anyOf(new Object[]{ o1, o2, o3, o4 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyOf\n\t * @param o A list of dummy objects returned by registering other matchers\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object anyOf(List<Object> o)\n\t{\n\t\treturn combined(fflib_MatcherDefinitions.Connective.AT_LEAST_ONE, o);\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches isNot\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object isNot(Object o1)\n\t{\n\t\treturn noneOf(new Object[]{ o1 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches noneOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object noneOf(Object o1, Object o2)\n\t{\n\t\treturn noneOf(new Object[]{ o1, o2 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches noneOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @param o3 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object noneOf(Object o1, Object o2, Object o3)\n\t{\n\t\treturn noneOf(new Object[]{ o1, o2, o3 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches noneOf\n\t * @param o1 A dummy object returned by registering another matcher\n\t * @param o2 A dummy object returned by registering another matcher\n\t * @param o3 A dummy object returned by registering another matcher\n\t * @param o4 A dummy object returned by registering another matcher\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object noneOf(Object o1, Object o2, Object o3, Object o4)\n\t{\n\t\treturn noneOf(new Object[]{ o1, o2, o3, o4 });\n\t}\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches noneOf\n\t * @param o A list of dummy objects returned by registering other matchers\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object noneOf(List<Object> o)\n\t{\n\t\treturn combined(fflib_MatcherDefinitions.Connective.NONE, o);\n\t}\n\t\n\tprivate static Object combined(fflib_MatcherDefinitions.Connective connectiveExpression, List<Object> o)\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.Combined(connectiveExpression, (gatherMatchers(o))));\n\t}\n\t\n\tprivate static List<fflib_IMatcher> gatherMatchers(Object[] ignoredMatcherObjects)\n\t{\n\t\tif (ignoredMatcherObjects == null || ignoredMatcherObjects.isEmpty())\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Must register matchers to combine');\n\t\t}\n\t\t\n\t\t//Each ignored matcher object represents a matcher that has been registered against fflib_Match.matchers,\n\t\t//but is actually for the connective matchers.\n\t\tList<fflib_IMatcher> innerMatchers = new List<fflib_IMatcher>();\n\t\t\n\t\tInteger innerMatcherCount = ignoredMatcherObjects.size();\n\t\twhile (innerMatchers.size() < innerMatcherCount)\n\t\t{\n\t\t\tif (matchers.isEmpty())\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Error reclaiming inner matchers for combined matcher. Wanted '\n\t\t\t\t\t+ innerMatcherCount + ' matchers but only got ' + innerMatchers);\n\t\t\t}\n\t\t\t\n\t\t\tfflib_IMatcher innerMatcher = matchers.remove(matchers.size()-1);\n\t\t\t\n\t\t\t//Add to the start of the list to preserve the order in which matchers were declared.\n\t\t\t//Note. Apex throws list index out of bounds if inserting an element into an empty list at index 0S\n\t\t\tif (!innerMatchers.isEmpty())\n\t\t\t{\n\t\t\t\tinnerMatchers.add(0, innerMatcher);\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tinnerMatchers.add(innerMatcher);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn innerMatchers;\n\t}\n\t\n\t/**\n\t * ALL OTHER MATCHER METHODS\n\t */\n\t\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eq\n\t * @param toMatch The Object to be compared\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object eq(Object toMatch)\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqBoolean\n\t * @param toMatch The Boolean to be compared\n\t * @return Boolean A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Boolean eqBoolean(Boolean toMatch)\n\t{\n\t\treturn (Boolean)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqDate\n\t * @param toMatch The Date to be compared\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date eqDate(Date toMatch)\n\t{\n\t\treturn (Date)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqDatetime\n\t * @param toMatch The Datetime to be compared\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime eqDatetime(Datetime toMatch)\n\t{\n\t\treturn (Datetime)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqDecimal\n\t * @param toMatch The Decimal to be compared\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal eqDecimal(Decimal toMatch)\n\t{\n\t\treturn (Decimal)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqDouble\n\t * @param toMatch The Double to be compared\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double eqDouble(Double toMatch)\n\t{\n\t\treturn (Double)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqId\n\t * @param toMatch The Id to be compared\n\t * @return Id A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Id eqId(Id toMatch)\n\t{\n\t\treturn (Id)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqInteger\n\t * @param toMatch The Integer to be compared\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer eqInteger(Integer toMatch)\n\t{\n\t\treturn (Integer)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqList\n\t * @param toMatch The List to be compared\n\t * @return List A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static List<Object> eqList(List<Object> toMatch)\n\t{\n\t\treturn (List<Object>)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqLong\n\t * @param toMatch The Long to be compared\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long eqLong(Long toMatch)\n\t{\n\t\treturn (Long)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqSObjectField\n\t * @param toMatch The SObjectField to be compared\n\t * @return SObjectField A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static SObjectField eqSObjectField(SObjectField toMatch)\n\t{\n\t\treturn (SObjectField)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqSObjectType\n\t * @param toMatch The SObjectType to be compared\n\t * @return SObjectType A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static SObjectType eqSObjectType(SObjectType toMatch)\n\t{\n\t\treturn (SObjectType)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches eqString\n\t * @param toMatch The String to be compared\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String eqString(String toMatch)\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.Eq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches refEq\n\t * @param toMatch The Object to be compared\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object refEq(Object toMatch)\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.RefEq(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyBoolean\n\t * @return Boolean A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Boolean anyBoolean()\n\t{\n\t\treturn (Boolean)matches(new fflib_MatcherDefinitions.AnyBoolean());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyDate\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date anyDate()\n\t{\n\t\treturn (Date)matches(new fflib_MatcherDefinitions.AnyDate());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyDatetime\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime anyDatetime()\n\t{\n\t\treturn (Datetime)matches(new fflib_MatcherDefinitions.AnyDatetime());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyDecimal\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal anyDecimal()\n\t{\n\t\treturn (Decimal)matches(new fflib_MatcherDefinitions.AnyDecimal());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyDouble\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double anyDouble()\n\t{\n\t\treturn (Double)matches(new fflib_MatcherDefinitions.AnyDouble());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyFieldSet\n\t * @return Schema.FieldSet A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Schema.FieldSet anyFieldSet()\n\t{\n\t\treturn (Schema.FieldSet)matches(new fflib_MatcherDefinitions.AnyFieldSet());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyId\n\t * @return Id A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Id anyId()\n\t{\n\t\treturn (Id)matches(new fflib_MatcherDefinitions.AnyId());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyInteger\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer anyInteger()\n\t{\n\t\treturn (Integer)matches(new fflib_MatcherDefinitions.AnyInteger());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyList\n\t * @return List A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static List<Object> anyList()\n\t{\n\t\treturn (List<Object>)matches(new fflib_MatcherDefinitions.AnyList());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyLong\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long anyLong()\n\t{\n\t\treturn (Long)matches(new fflib_MatcherDefinitions.AnyLong());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyObject\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object anyObject()\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.AnyObject());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anyString\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String anyString()\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.AnyString());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anySObject\n\t * @return SObject A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static SObject anySObject()\n\t{\n\t\treturn (SObject)matches(new fflib_MatcherDefinitions.AnySObject());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anySObjectField\n\t * @return SObjectField A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static SObjectField anySObjectField()\n\t{\n\t\treturn (SObjectField)matches(new fflib_MatcherDefinitions.AnySObjectField());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches anySObjectType\n\t * @return SObjectType A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static SObjectType anySObjectType()\n\t{\n\t\treturn (SObjectType)matches(new fflib_MatcherDefinitions.AnySObjectType());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches dateAfter (not inclusive)\n\t * @param fromDate The Date to be compared\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date dateAfter(Date fromDate)\n\t{\n\t\treturn dateAfter(fromDate, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches dateAfter\n\t * @param fromDate The Date to be compared\n\t * @param inclusive Whether or not a Date equal to fromDate should be considered a match\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date dateAfter(Date fromDate, Boolean inclusive)\n\t{\n\t\treturn (Date)matches(new fflib_MatcherDefinitions.DatetimeAfter(fromDate, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches dateBefore (not inclusive)\n\t * @param toDate The Date to be compared\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date dateBefore(Date toDate)\n\t{\n\t\treturn dateBefore(toDate, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches dateBefore\n\t * @param toDate The Date to be compared\n\t * @param inclusive Whether or not a Date equal to toDate should be considered a match\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date dateBefore(Date toDate, Boolean inclusive)\n\t{\n\t\treturn (Date)matches(new fflib_MatcherDefinitions.DatetimeBefore(toDate, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches dateBetween (not inclusive)\n\t * @param fromDate The lower bound Date to be compared\n\t * @param toDate The upper bound Date to be compared\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date dateBetween(Date fromDate, Date toDate)\n\t{\n\t\treturn dateBetween(fromDate, false, toDate, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches dateBetween\n\t * @param fromDate The lower bound Date to be compared\n\t * @param inclusiveFrom Whether or not a Date equal to fromDate should be considered a match\n\t * @param toDate The upper bound Date to be compared\n\t * @param inclusiveTo Whether or not a Date equal to toDate should be considered a match\n\t * @return Date A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Date dateBetween(Date fromDate, Boolean inclusiveFrom, Date toDate, Boolean inclusiveTo)\n\t{\n\t\treturn (Date)matches(new fflib_MatcherDefinitions.DatetimeBetween(fromDate, inclusiveFrom, toDate, inclusiveTo));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches datetimeAfter (not inclusive)\n\t * @param fromDate The Datetime to be compared\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime datetimeAfter(Datetime fromDate)\n\t{\n\t\treturn datetimeAfter(fromDate, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches datetimeAfter\n\t * @param fromDate The Datetime to be compared\n\t * @param inclusive Whether or not a Datetime equal to fromDate should be considered a match\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime datetimeAfter(Datetime fromDate, Boolean inclusive)\n\t{\n\t\treturn (Datetime)matches(new fflib_MatcherDefinitions.DatetimeAfter(fromDate, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches datetimeBefore (not inclusive)\n\t * @param toDate The Datetime to be compared\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime datetimeBefore(Datetime toDate)\n\t{\n\t\treturn datetimeBefore(toDate, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches datetimeBefore\n\t * @param toDate The Datetime to be compared\n\t * @param inclusive Whether or not a Datetime equal to toDate should be considered a match\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime datetimeBefore(Datetime toDate, Boolean inclusive)\n\t{\n\t\treturn (Datetime)matches(new fflib_MatcherDefinitions.DatetimeBefore(toDate, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches datetimeBetween (not inclusive)\n\t * @param fromDate The lower bound Datetime to be compared\n\t * @param toDate The upper bound Datetime to be compared\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime datetimeBetween(Datetime fromDate, Datetime toDate)\n\t{\n\t\treturn datetimeBetween(fromDate, false, toDate, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches datetimeBetween\n\t * @param fromDate The lower bound Datetime to be compared\n\t * @param inclusiveFrom Whether or not a Datetime equal to fromDate should be considered a match\n\t * @param toDate The upper bound Datetime to be compared\n\t * @param inclusiveTo Whether or not a Datetime equal to toDate should be considered a match\n\t * @return Datetime A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Datetime datetimeBetween(Datetime fromDate, Boolean inclusiveFrom, Datetime toDate, Boolean inclusiveTo)\n\t{\n\t\treturn (Datetime)matches(new fflib_MatcherDefinitions.DatetimeBetween(fromDate, inclusiveFrom, toDate, inclusiveTo));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches decimalBetween (not inclusive)\n\t * @param lower The lower number to be compared\n\t * @param upper The upper number to be compared\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal decimalBetween(Decimal lower, Decimal upper)\n\t{\n\t\treturn decimalBetween(lower, false, upper, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches decimalBetween\n\t * @param lower The lower number to be compared\n\t * @param inclusiveLower Whether or not a number equal to the lower bound should be considered a match\n\t * @param upper The upper number to be compared\n\t * @param inclusiveUpper Whether or not a number equal to the upper bound should be considered a match\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal decimalBetween(Decimal lower, Boolean inclusiveLower, Decimal upper, Boolean inclusiveUpper)\n\t{\n\t\treturn (Decimal)matches(new fflib_MatcherDefinitions.DecimalBetween(lower, inclusiveLower, upper, inclusiveUpper));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches decimalLessThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal decimalLessThan(Decimal toMatch)\n\t{\n\t\treturn decimalLessThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches decimalLessThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal decimalLessThan(Decimal toMatch, Boolean inclusive)\n\t{\n\t\treturn (Decimal)matches(new fflib_MatcherDefinitions.DecimalLessThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches decimalMoreThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal decimalMoreThan(Decimal toMatch)\n\t{\n\t\treturn decimalMoreThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches decimalMoreThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Decimal A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Decimal decimalMoreThan(Decimal toMatch, Boolean inclusive)\n\t{\n\t\treturn (Decimal)matches(new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches doubleBetween (not inclusive)\n\t * @param lower The lower number to be compared\n\t * @param upper The upper number to be compared\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double doubleBetween(Double lower, Double upper)\n\t{\n\t\treturn doubleBetween(lower, false, upper, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches doubleBetween\n\t * @param lower The lower number to be compared\n\t * @param inclusiveLower Whether or not a number equal to the lower bound should be considered a match\n\t * @param upper The upper number to be compared\n\t * @param inclusiveUpper Whether or not a number equal to the upper bound should be considered a match\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double doubleBetween(Double lower, Boolean inclusiveLower, Double upper, Boolean inclusiveUpper)\n\t{\n\t\treturn (Double)matches(new fflib_MatcherDefinitions.DecimalBetween(lower, inclusiveLower, upper, inclusiveUpper));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches doubleLessThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double doubleLessThan(Double toMatch)\n\t{\n\t\treturn doubleLessThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches doubleLessThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double doubleLessThan(Double toMatch, Boolean inclusive)\n\t{\n\t\treturn (Double)matches(new fflib_MatcherDefinitions.DecimalLessThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches doubleMoreThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double doubleMoreThan(Double toMatch)\n\t{\n\t\treturn doubleMoreThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches doubleMoreThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Double A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Double doubleMoreThan(Double toMatch, Boolean inclusive)\n\t{\n\t\treturn (Double)matches(new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches FieldSetEquivalentTo\n\t * @param toMatch The fieldSet to be compared\n\t * @return Schema.FieldSet A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Schema.FieldSet fieldSetEquivalentTo(Schema.FieldSet toMatch)\n\t{\n\t\treturn (Schema.FieldSet)matches(new fflib_MatcherDefinitions.FieldSetEquivalentTo(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches integerBetween (not inclusive)\n\t * @param lower The lower number to be compared\n\t * @param upper The upper number to be compared\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer integerBetween(Integer lower, Integer upper)\n\t{\n\t\treturn integerBetween(lower, false, upper, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches integerBetween\n\t * @param lower The lower number to be compared\n\t * @param inclusiveLower Whether or not a number equal to the lower bound should be considered a match\n\t * @param upper The upper number to be compared\n\t * @param inclusiveUpper Whether or not a number equal to the upper bound should be considered a match\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer integerBetween(Integer lower, Boolean inclusiveLower, Integer upper, Boolean inclusiveUpper)\n\t{\n\t\treturn (Integer)matches(new fflib_MatcherDefinitions.DecimalBetween(lower, inclusiveLower, upper, inclusiveUpper));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches integerLessThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer integerLessThan(Integer toMatch)\n\t{\n\t\treturn integerLessThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches integerLessThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer integerLessThan(Integer toMatch, Boolean inclusive)\n\t{\n\t\treturn (Integer)matches(new fflib_MatcherDefinitions.DecimalLessThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches integerMoreThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer integerMoreThan(Integer toMatch)\n\t{\n\t\treturn integerMoreThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches integerMoreThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Integer A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Integer integerMoreThan(Integer toMatch, Boolean inclusive)\n\t{\n\t\treturn (Integer)matches(new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches isNotNull\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object isNotNull()\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.IsNotNull());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches isNull\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object isNull()\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.IsNull());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches listContains\n\t * @param toMatch The list to be compared\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object listContains(Object toMatch)\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.ListContains(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches listIsEmpty\n\t * @return Object A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked. (You may need to cast down to your specific object type)\n\t */\n\tpublic static Object listIsEmpty()\n\t{\n\t\treturn matches(new fflib_MatcherDefinitions.ListIsEmpty());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches longBetween (not inclusive)\n\t * @param lower The lower number to be compared\n\t * @param upper The upper number to be compared\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long longBetween(Long lower, Long upper)\n\t{\n\t\treturn longBetween(lower, false, upper, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches longBetween\n\t * @param lower The lower number to be compared\n\t * @param inclusiveLower Whether or not a number equal to the lower bound should be considered a match\n\t * @param upper The upper number to be compared\n\t * @param inclusiveUpper Whether or not a number equal to the upper bound should be considered a match\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long longBetween(Long lower, Boolean inclusiveLower, Long upper, Boolean inclusiveUpper)\n\t{\n\t\treturn (Long)matches(new fflib_MatcherDefinitions.DecimalBetween(lower, inclusiveLower, upper, inclusiveUpper));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches longLessThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long longLessThan(Long toMatch)\n\t{\n\t\treturn longLessThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches longLessThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long longLessThan(Long toMatch, Boolean inclusive)\n\t{\n\t\treturn (Long)matches(new fflib_MatcherDefinitions.DecimalLessThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches longMoreThan (not inclusive)\n\t * @param toMatch The number to be compared\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long longMoreThan(Long toMatch)\n\t{\n\t\treturn longMoreThan(toMatch, false);\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches longMoreThan\n\t * @param toMatch The number to be compared\n\t * @param inclusive Whether or not a number equal to toMatch should be considered a match\n\t * @return Long A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static Long longMoreThan(Long toMatch, Boolean inclusive)\n\t{\n\t\treturn (Long)matches(new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, inclusive));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an SObject of specified SObjectType\n\t * @param objectType The SObjectType to be compared\n\t * @return SObject a dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked\n\t */\n\tpublic static SObject sObjectOfType(Schema.SObjectType objectType)\n\t{\n\t\treturn (SObject)matches(new fflib_MatcherDefinitions.SObjectOfType(objectType));\n\t}\n\t/**\n\t * Registers a matcher which will check if the method is called with an SObject\n\t * @param toMatch A Map of SObjectFields to required values, to be compared to concrete SObject records\n\t * @return SObject a dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked\n\t */\n\tpublic static SObject sObjectWith(Map<Schema.SObjectField, Object> toMatch)\n\t{\n\t\treturn (SObject)matches(new fflib_MatcherDefinitions.SObjectWith(toMatch));\n\t}\n\t/**\n\t * Registers a matcher which will check if the method is called with a list of SObject\n\t * @param toMatch A list of Map of SObjectFields to required values, to be compared to concrete SObject records\n\t * @return SObject a dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked\n\t */\n\tpublic static SObject[] sObjectsWith(list<Map<Schema.SObjectField, Object>> toMatch)\n\t{\n\t\treturn (SObject[])matches(new fflib_MatcherDefinitions.SObjectsWith(toMatch,true));\n\t}\n    \n\t/**\n\t * Registers a matcher which will check if the method is called with a list of SObject\n\t * @param toMatch A list of Map of SObjectFields to required values, to be compared to concrete SObject records. Comparison can be order dependent\n\t * @return SObject a dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked\n\t */\n\tpublic static SObject[] sObjectsWith(list<Map<Schema.SObjectField, Object>> toMatch, Boolean matchInOrder)\n\t{\n\t\treturn (SObject[])matches(new fflib_MatcherDefinitions.SObjectsWith(toMatch,matchInOrder));\n\t}\n    \n\t/**\n\t * Registers a matcher which will check if the method is called with an SObject\n\t * @param toMatch The Id to be compared\n\t * @return SObject a dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked\n\t */\n\tpublic static SObject sObjectWithId(Id toMatch)\n\t{\n\t\treturn (SObject)matches(new fflib_MatcherDefinitions.SObjectWithId(toMatch));\n\t}\n\t/**\n\t * Registers a matcher which will check if the method is called with an SObject\n\t * @param toMatch The name to be compared\n\t * @return SObject a dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked\n\t */\n\tpublic static SObject sObjectWithName(String toMatch)\n\t{\n\t\treturn (SObject)matches(new fflib_MatcherDefinitions.SObjectWithName(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches stringContains\n\t * @param toMatch The substring to be compared\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String stringContains(String toMatch)\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.StringContains(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches stringEndsWith\n\t * @param toMatch The substring to be compared\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String stringEndsWith(String toMatch)\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.StringEndsWith(toMatch));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches stringIsBlank\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String stringIsBlank()\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.StringIsBlank());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches stringIsNotBlank\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String stringIsNotBlank()\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.StringIsNotBlank());\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches stringMatches\n\t * @param regEx The regex String to be compared\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String stringMatches(String regEx)\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.StringMatches(regEx));\n\t}\n\n\t/**\n\t * Registers a matcher which will check if the method is called with an arg that matches stringStartsWith\n\t * @param toMatch The substring to be compared\n\t * @return String A dummy object of the correct type, so that when called inline as part of a method call, the correct method is invoked.\n\t */\n\tpublic static String stringStartsWith(String toMatch)\n\t{\n\t\treturn (String)matches(new fflib_MatcherDefinitions.StringStartsWith(toMatch));\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_Match.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MatcherDefinitions.cls",
    "content": "/**\n * Copyright (c) 2014-2017, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Class providing Apex Mocks standard matcher implementations.\n * You shouldn't need to reference the classes directly outside of the ApexMocks framework, instead use the equivalent helper method in fflib_Match\n * to construct the matcher, register the matcher and return an object of the correct type to be called in your unit test.\n * E.g. Don't construct Eq(Object toMatch), instead call fflib_Match.eq(Object toMatch).\n */\n@NamespaceAccessible\npublic with sharing class fflib_MatcherDefinitions\n{\n\t/**\n\t * Connective - Enum representing the possible operators for the Combined matcher. Possible values: ALL, AT_LEAST_ONE, NONE\n\t */\n\tpublic Enum Connective\n\t{\n\t\tALL,\n\t\tAT_LEAST_ONE,\n\t\tNONE\n\t}\n\t\n\t/*\n\t * COMBINED MATCHER\n\t */\n\t\n\t/**\n\t * Combined matcher: compares the supplied argument matches one, all or none of the internal matchers\n\t */\n\t@NamespaceAccessible\n\tpublic class Combined implements fflib_IMatcher\n\t{\n\t\tprivate Connective connectiveExpression;\n\t\tprivate List<fflib_IMatcher> internalMatchers;\n\t\t\n\t\t/**\n\t\t * Combined constructor\n\t\t * @param connectiveExpression Controls the combination mode, i.e. if we need to match all, any or none of the inner matchers\n\t\t * @param internalMatchers An ordered list of the internal matchers to be combined\n\t\t * @return fflib_MatcherDefinitions.Combined A new Combined instance\n\t\t */\n\t\tpublic Combined(Connective connectiveExpression, List<fflib_IMatcher> internalMatchers)\n\t\t{\n\t\t\tthis.connectiveExpression = validate(connectiveExpression);\n\t\t\tthis.internalMatchers = validate(internalMatchers);\n\t\t}\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tfor (fflib_IMatcher internalMatcher : internalMatchers)\n\t\t\t{\n\t\t\t\tif (internalMatcher.matches(arg))\n\t\t\t\t{\n\t\t\t\t\tif (connectiveExpression == Connective.AT_LEAST_ONE)\n\t\t\t\t\t{\n\t\t\t\t\t\t//At least one match => success!\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (connectiveExpression == Connective.NONE)\n\t\t\t\t\t{\n\t\t\t\t\t\t//At least one match => failure!\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (connectiveExpression == Connective.ALL)\n\t\t\t\t{\n\t\t\t\t\t//At least one mismatch => failure!\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//We didn't return early.\n\t\t\t//If matching any, must have been no matches => failure!\n\t\t\t//If matching all, must have been all matches => success!\n\t\t\t//If matching none, must have been all mismatches => success!\n\t\t\treturn connectiveExpression != Connective.AT_LEAST_ONE;\n\t\t}\n\t\t\n\t\tprivate Connective validate(Connective connectiveExpression)\n\t\t{\n\t\t\tif (connectiveExpression == null)\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Invalid connective expression: ' + connectiveExpression);\n\t\t\t}\n\t\t\t\n\t\t\treturn connectiveExpression;\n\t\t}\n\t\t\n\t\tprivate List<fflib_IMatcher>  validate(List<fflib_IMatcher> innerMatchers)\n\t\t{\n\t\t\tif (innerMatchers == null || innerMatchers.isEmpty())\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Invalid inner matchers: ' + innerMatchers);\n\t\t\t}\n\t\t\t\n\t\t\treturn innerMatchers;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\tList<String> internalDescriptions = new List<String>();\n\t\t\tfor (fflib_IMatcher internalMatcher : internalMatchers)\n\t\t\t{\n\t\t\t\tinternalDescriptions.add('' + internalMatcher);\n\t\t\t}\n\t\t\tString internalDescription = String.join(internalDescriptions, ', ');\n\n\t\t\tswitch on connectiveExpression\n\t\t\t{\n\t\t\t\twhen AT_LEAST_ONE\n\t\t\t\t{\n\t\t\t\t\treturn '[any of: ' + internalDescription + ']';\n\t\t\t\t}\n\t\t\t\twhen ALL\n\t\t\t\t{\n\t\t\t\t\treturn '[all of: ' + internalDescription + ']';\n\t\t\t\t}\n\t\t\t\twhen else\n\t\t\t\t{\n\t\t\t\t\treturn '[none of: ' + internalDescription + ']';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/*\n\t * OBJECT MATCHERS\n\t */\n\t\n\t/**\n\t * Eq matcher: checks if the supplied argument is equal (==) to a specified object\n\t */\n\t@NamespaceAccessible\n\tpublic class Eq implements fflib_IMatcher\n\t{\n\t\tprivate Object toMatch;\n\t\t\n\t\t/**\n\t\t * Eq constructor\n\t\t * @param toMatch The object to be compared\n\t\t * @return fflib_MatcherDefinitions.Eq A new Eq instance\n\t\t */\n\t\tpublic Eq(Object toMatch)\n\t\t{\n\t\t\tthis.toMatch = validateNotNull(toMatch);\n\t\t}\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn toMatch == arg;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[equals ' + stringify(toMatch) + ']';\n\t\t}\n\t}\n\t\n\t/**\n\t * RefEq matcher: checks if the supplied argument is a reference to the same object (===) as a specified object\n\t */\n\t@NamespaceAccessible\n\tpublic class RefEq implements fflib_IMatcher\n\t{\n\t\tprivate Object toMatch;\n\t\t\n\t\t/**\n\t\t * RefEq constructor\n\t\t * @param toMatch The object to be compared\n\t\t * @return fflib_MatcherDefinitions.RefEq A new RefEq instance\n\t\t */\n\t\tpublic RefEq(Object toMatch)\n\t\t{\n\t\t\tthis.toMatch = validateNotNull(toMatch);\n\t\t}\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn toMatch === arg;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[reference equals ' + fflib_MatcherDefinitions.stringify(toMatch) + ']';\n\t\t}\n\t}\n\t\n\t/*\n\t * ANY MATCHERS\n\t */\n\n\t/**\n\t * AnyBoolean matcher: checks if the supplied argument is an instance of a Boolean\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyBoolean implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Boolean;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Boolean]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyDate matcher: checks if the supplied argument is an instance of a Date\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyDate implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Date;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Date]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyDatetime matcher: checks if the supplied argument is an instance of a Datetime\n\t@NamespaceAccessible\n\t */\n\tpublic class AnyDatetime implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Datetime;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any DateTime]';\n\t\t}\n\t}\n\n\t/**\n\t@NamespaceAccessible\n\t * AnyDecimal matcher: checks if the supplied argument is an instance of a Decimal\n\t */\n\tpublic class AnyDecimal implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Decimal;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Decimal]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyDouble matcher: checks if the supplied argument is an instance of a Double\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyDouble implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Double;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Double]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyFieldSet matcher: checks if the supplied argument is an instance of a FieldSet\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyFieldSet implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Schema.FieldSet;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any FieldSet]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyId matcher: checks if the supplied argument is an instance of an Id\n\t@NamespaceAccessible\n\t */\n\tpublic class AnyId implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Id;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Id]';\n\t\t}\n\t}\n\t\n\t/**\n\t@NamespaceAccessible\n\t * AnyInteger matcher: checks if the supplied argument is an instance of an Integer\n\t */\n\tpublic class AnyInteger implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Integer;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Integer]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyList matcher: checks if the supplied argument is an instance of a List\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyList implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof List<Object>;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any list]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyLong matcher: checks if the supplied argument is an instance of a Long\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyLong implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof Long;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Long]';\n\t\t}\n\t}\n\n\t/**\n\t * AnyObject matcher: checks if the supplied argument is an instance of an Object\n\t */\n\tpublic class AnyObject implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any Object]';\n\t\t}\n\t}\n\t\n\t/**\n\t * AnyString matcher: checks if the supplied argument is an instance of a String\n\t */\n\t@NamespaceAccessible\n\tpublic class AnyString implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof String;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any String]';\n\t\t}\n\t}\n\n\t/**\n\t * AnySObject matcher: checks if the supplied argument is an instance of an SObject\n\t */\n\t@NamespaceAccessible\n\tpublic class AnySObject implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof SObject;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any SObject]';\n\t\t}\n\t}\n\n\t/**\n\t * AnySObjectField matcher: checks if the supplied argument is an instance of an SObjectField\n\t */\n\t@NamespaceAccessible\n\tpublic class AnySObjectField implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof SObjectField;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any SObjectField]';\n\t\t}\n\t}\n\n\t/**\n\t * AnySObjectType matcher: checks if the supplied argument is an instance of an SObjectType\n\t@NamespaceAccessible\n\t */\n\tpublic class AnySObjectType implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof SObjectType;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[any SObjectType]';\n\t\t}\n\t}\n\t\n\t/*\n\t * DATETIME MATCHERS\n\t */\n\n\t/**\n\t * DatetimeAfter matcher: checks if the supplied argument is after a specified datetime\n\t */\n\t@NamespaceAccessible\n\tpublic class DatetimeAfter implements fflib_IMatcher\n\t{\n\t\tprivate Datetime fromDatetime;\n\t\tprivate Boolean inclusive;\n\t\t\n\t\t/**\n\t\t * DatetimeAfter constructor\n\t\t * @param fromDatetime The datetime to be compared\n\t\t * @param inclusive Whether or not dates equal to the fromDatetime should be considered a match\n\t\t * @return fflib_MatcherDefinitions.DatetimeAfter A new DatetimeAfter instance\n\t\t */\n\t\tpublic DatetimeAfter(Datetime fromDatetime, Boolean inclusive)\n\t\t{\n\t\t\tthis.fromDatetime = (Datetime)validateNotNull(fromDatetime);\n\t\t\tthis.inclusive = (Boolean)validateNotNull(inclusive);\n\t\t}\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg instanceof Datetime)\n\t\t\t{\n\t\t\t\tDatetime datetimeToCompare = (Datetime)arg;\n\t\t\t\treturn inclusive ? fromDatetime <= datetimeToCompare : fromDatetime < datetimeToCompare;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\tif (inclusive)\n\t\t\t{\n\t\t\t\treturn '[on or after ' + JSON.serialize(fromDateTime) + ']';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '[after ' + JSON.serialize(fromDateTime) + ']';\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * DatetimeBefore matcher: checks if the supplied argument is before a specified datetime\n\t */\n\t@NamespaceAccessible\n\tpublic class DatetimeBefore implements fflib_IMatcher\n\t{\n\t\tprivate Datetime toDatetime;\n\t\tprivate Boolean inclusive;\n\t\t\n\t\t/**\n\t\t * DatetimeBefore constructor\n\t\t * @param toDatetime The datetime to be compared\n\t\t * @param inclusive Whether or not dates equal to the toDatetime should be considered a match\n\t\t * @return fflib_MatcherDefinitions.DatetimeBefore A new DatetimeBefore instance\n\t\t */\n\t\tpublic DatetimeBefore(Datetime toDatetime, Boolean inclusive)\n\t\t{\n\t\t\tthis.toDatetime = (Datetime)validateNotNull(toDatetime);\n\t\t\tthis.inclusive = (Boolean)validateNotNull(inclusive);\n\t\t}\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg instanceof Datetime)\n\t\t\t{\n\t\t\t\tDatetime datetimeToCompare = (Datetime)arg;\n\t\t\t\treturn inclusive ? datetimeToCompare <= toDatetime : datetimeToCompare < toDatetime;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\tif (inclusive)\n\t\t\t{\n\t\t\t\treturn '[on or before ' + JSON.serialize(toDateTime) + ']';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '[before ' + JSON.serialize(toDateTime) + ']';\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * DatetimeBetween matcher: checks if the supplied argument is between two specified datetimes\n\t */\n\t@NamespaceAccessible\n\tpublic class DatetimeBetween implements fflib_IMatcher\n\t{\n\t\tprivate Datetime fromDatetime;\n\t\tprivate Boolean inclusiveFrom;\n\t\tprivate Datetime toDatetime;\n\t\tprivate Boolean inclusiveTo;\n\t\t\n\t\t/**\n\t\t * DatetimeBetween constructor\n\t\t * @param fromDatetime The lower bound datetime to be compared\n\t\t * @param inclusiveFrom Whether or not dates equal to the fromDatetime should be considered a match\n\t\t * @param toDatetime The upper bound dateetime to be compared\n\t\t * @param inclusiveTo Whether or not dates equal to the toDatetime should be considered a match\n\t\t * @return fflib_MatcherDefinitions.DatetimeBetween A new DatetimeBetween instance\n\t\t */\n\t\tpublic DatetimeBetween(Datetime fromDatetime, Boolean inclusiveFrom, Datetime toDatetime, Boolean inclusiveTo)\n\t\t{\n\t\t\tthis.fromDatetime = (Datetime)validateNotNull(fromDatetime);\n\t\t\tthis.inclusiveFrom = (Boolean)validateNotNull(inclusiveFrom);\n\t\t\tthis.toDatetime = (Datetime)validateNotNull(toDatetime);\n\t\t\tthis.inclusiveTo = (Boolean)validateNotNull(inclusiveTo);\n\t\t}\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg instanceof Datetime)\n\t\t\t{\n\t\t\t\tDatetime datetimeToCompare = (Datetime)arg;\n\t\t\t\tif ((inclusiveFrom ? datetimeToCompare >= fromDatetime : datetimeToCompare > fromDatetime)\n\t\t\t\t\t&& (inclusiveTo ? datetimeToCompare <= toDatetime : datetimeToCompare < toDatetime))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn String.format('[{0} {1} and {2} {3}]', new List<String>{\n\t\t\t\tinclusiveFrom ? 'on or after' : 'after',\n\t\t\t\tJSON.serialize(fromDateTime),\n\t\t\t\tinclusiveTo ? 'on or before' : 'before',\n\t\t\t\tJSON.serialize(toDateTime)\n\t\t\t});\n\t\t}\n\t}\n\n\t/*\n\t * DECIMAL (AND OTHER NUMBER) MATCHERS\n\t */\n\t\n\t/**\n\t * DecimalBetween matcher: checks if the supplied argument is between two specified decimals\n\t */\n\t@NamespaceAccessible\n\tpublic class DecimalBetween implements fflib_IMatcher\n\t{\n\t\tprivate Decimal lower;\n\t\tprivate Boolean inclusiveLower;\n\t\tprivate Decimal upper;\n\t\tprivate Boolean inclusiveUpper;\n\n\t\t/**\n\t\t * DecimalBetween constructor\n\t\t * @param lower The lower bound number to be compared\n\t\t * @param inclusiveLower Whether or not numbers equal to lower should be considered a match\n\t\t * @param upper The upper bound number to be compared\n\t\t * @param inclusiveUpper Whether or not numbers equal to upper should be considered a match\n\t\t * @return fflib_MatcherDefinitions.DecimalBetween A new DecimalBetween instance\n\t\t */\n\t\tpublic DecimalBetween(Decimal lower, Boolean inclusiveLower, Decimal upper, Boolean inclusiveUpper)\n\t\t{\n\t\t\tthis.lower = (Decimal)validateNotNull(lower);\n\t\t\tthis.inclusiveLower = (Boolean)validateNotNull(inclusiveLower);\n\t\t\tthis.upper = (Decimal)validateNotNull(upper);\n\t\t\tthis.inclusiveUpper = (Boolean)validateNotNull(inclusiveUpper);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof Decimal)\n\t\t\t{\n\t\t\t\tDecimal longArg = (Decimal)arg;\n\n\t\t\t\tif ((inclusiveLower ? longArg >= lower : longArg > lower)\n\t\t\t\t\t&& (inclusiveUpper ? longArg <= upper : longArg < upper))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn String.format('{0} {1} and {2} {3}', new List<String>{\n\t\t\t\tinclusiveLower ? 'greater than or equal to' : 'greater than',\n\t\t\t\t'' + lower,\n\t\t\t\tinclusiveUpper ? 'less than or equal to' : 'less than',\n\t\t\t\t'' + upper\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * DecimalLessThan matcher: checks if the supplied argument is less than a specified decimal\n\t */\n\t@NamespaceAccessible\n\tpublic class DecimalLessThan implements fflib_IMatcher\n\t{\n\t\tprivate Decimal toMatch;\n\t\tprivate Boolean inclusive;\n\n\t\t/**\n\t\t * DecimalLessThan constructor\n\t\t * @param toMatch The number to be compared against\n\t\t * @param inclusive Whether or not numbers equal to toMatch should be considered a match\n\t\t * @return fflib_MatcherDefinitions.DecimalLessThan A new DecimalLessThan instance\n\t\t */\n\t\tpublic DecimalLessThan(Decimal toMatch, Boolean inclusive)\n\t\t{\n\t\t\tthis.toMatch = (Decimal)validateNotNull(toMatch);\n\t\t\tthis.inclusive = (Boolean)validateNotNull(inclusive);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof Decimal)\n\t\t\t{\n\t\t\t\tDecimal longArg = (Decimal)arg;\n\t\t\t\treturn inclusive ? longArg <= toMatch : longArg < toMatch;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\tif (inclusive)\n\t\t\t{\n\t\t\t\treturn '[less than or equal to ' + toMatch + ']';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '[less than ' + toMatch + ']';\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * DecimalMoreThan matcher: checks if the supplied argument is greater than a specified decimal\n\t */\n\t@NamespaceAccessible\n\tpublic class DecimalMoreThan implements fflib_IMatcher\n\t{\n\t\tprivate Decimal toMatch;\n\t\tprivate Boolean inclusive;\n\n\t\t/**\n\t\t * DecimalMoreThan constructor\n\t\t * @param toMatch The number to be compared against\n\t\t * @param inclusive Whether or not numbers equal to toMatch should be considered a match\n\t\t * @return fflib_MatcherDefinitions.DecimalMoreThan A new DecimalMoreThan instance\n\t\t */\n\t\tpublic DecimalMoreThan(Decimal toMatch, Boolean inclusive)\n\t\t{\n\t\t\tthis.toMatch = (Decimal)validateNotNull(toMatch);\n\t\t\tthis.inclusive = (Boolean)validateNotNull(inclusive);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof Decimal)\n\t\t\t{\n\t\t\t\tDecimal longArg = (Decimal)arg;\n\t\t\t\treturn inclusive ? longArg >= toMatch : longArg > toMatch;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\tif (inclusive)\n\t\t\t{\n\t\t\t\treturn '[greater than or equal to ' + toMatch + ']';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '[greater than ' + toMatch + ']';\n\t\t\t}\n\t\t}\n\t}\n\n\t/** \n\t * FIELDSET MATCHERS\n\t */\n\t\n\t/**\n\t * FieldSetEquivalentTo matcher: checks the supplied argument is a field set with the same field set members as a specified field set\n\t * This matcher is needed because equivalent FieldSets do not pass == checks, and we can't override equals/hashcode on FieldSets.\n\t */\n\t@NamespaceAccessible\n\tpublic class FieldSetEquivalentTo implements fflib_IMatcher\n\t{\n\t\tprivate final Set<Schema.FieldSetMember> toMatch;\n\n\t\t/*\n\t\t * Dirty test-only constructor, allowing us to test this class even if there are no field sets defined in the current org.\n\t\t */\n\t\t@TestVisible\n\t\tpublic FieldSetEquivalentTo()\n\t\t{\n\t\t\tthis.toMatch = null;\n\t\t}\n\n\t\tpublic FieldSetEquivalentTo(Schema.FieldSet toMatch)\n\t\t{\n\t\t\tthis.toMatch = new Set<Schema.FieldSetMember>(((Schema.FieldSet)validateNotNull(toMatch)).getFields());\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn (toMatch != null && arg != null && arg instanceof Schema.FieldSet) ? toMatch == new Set<Schema.FieldSetMember>(((FieldSet)arg).getFields()) : false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[FieldSet with fields ' + fflib_MatcherDefinitions.stringify(toMatch) + ']';\n\t\t}\n\t}\n\n\t/*\n\t * IS MATCHERS\n\t */\n\t\n\t/**\n\t * IsNotNull matcher: checks the supplied argument is not null\n\t@NamespaceAccessible\n\t */\n\tpublic class IsNotNull implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[is not null]';\n\t\t}\n\t}\n\t\n\t/**\n\t * IsNull matcher: checks the supplied argument is null\n\t */\n\t@NamespaceAccessible\n\tpublic class IsNull implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg == null;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[is null]';\n\t\t}\n\t}\n\n\t/*\n\t * LIST MATCHERS\n\t */\n\t\n\t/**\n\t * ListContains matcher: checks if the supplied argument is equal (==) to any of the elements in a specified list\n\t */\n\t@NamespaceAccessible\n\tpublic class ListContains implements fflib_IMatcher\n\t{\n\t\tprivate Object toMatch;\n\t\t\n\t\t/**\n\t\t * ListContains constructor\n\t\t * @param toMatch The list of objects to be compared\n\t\t * @return fflib_MatcherDefinitions.ListContains A new ListContains instance\n\t\t */\n\t\tpublic ListContains(Object toMatch)\n\t\t{\n\t\t\tthis.toMatch = toMatch;\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof List<Object>)\n\t\t\t{\n\t\t\t\tfor (Object o : (List<Object>)arg)\n\t\t\t\t{\n\t\t\t\t\tif (o == toMatch)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[list containing ' + fflib_MatcherDefinitions.stringify(toMatch) + ']';\n\t\t}\n\t}\n\n\t/**\n\t * ListIsEmpty matcher: checks if the supplied argument is an empty list\n\t@NamespaceAccessible\n\t */\n\tpublic class ListIsEmpty implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null\n\t\t\t\t&& arg instanceof List<Object>\n\t\t\t\t&& ((List<Object>)arg).isEmpty();\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[empty list]';\n\t\t}\n\t}\n\n\t/*\n\t * SOBJECT MATCHERS\n\t */\n\t\n\t/**\n\t * SObjectOfType matcher: checks if the supplied argument has the specified SObjectType\n\t@NamespaceAccessible\n\t */\n\tpublic class SObjectOfType implements fflib_IMatcher\n\t{\n\t\tprivate Schema.SObjectType objectType;\n\n\t\t/**\n\t\t * SObjectOfType constructor\n\t\t * @param objectType The SObjectType to be compared\n\t\t * @return fflib_MatcherDefinitions.SObjectOfType A new SObjectOfType instance\n\t\t */\n\t\tpublic SObjectOfType(Schema.SObjectType objectType)\n\t\t{\n\t\t\tthis.objectType = (Schema.SObjectType)validateNotNull(objectType);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof SObject)\n\t\t\t{\n\t\t\t\tSObject soArg = (SObject)arg;\n\t\t\t\treturn soArg.getSObjectType() == objectType;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[SObject of type ' + objectType + ']';\n\t\t}\n\t}\n\n\t/**\n\t * SObjectWith matcher: compares the supplied argument against a Map<Schema.SObjectField, Object>, representing fields and their expected values.\n\t * Note. this method silently catches exceptions getting values for the supplied fields from the arguments supplied in method calls.\n\t * \n\t * If your matcher is mysteriously failing for your SObject record, it may be getting silent 'SObject row was retrieved via SOQL without querying\n\t * the requested field' exceptions, because you haven't queried all of the fields used in this matcher.\n\t */\n\t@NamespaceAccessible\n\tpublic class SObjectWith implements fflib_IMatcher\n\t{\n\t\tprivate Map<Schema.SObjectField, Object> toMatch;\n\n\t\t/**\n\t\t * SObjectWith constructor\n\t\t * @param toMatch A map of fields to their values to be compared. We compare each of these fields against the supplied sobject's field values.\n\t\t * @return fflib_MatcherDefinitions.SObjectWith A new SObjectWith instance\n\t\t */\n\t\tpublic SObjectWith(Map<Schema.SObjectField, Object> toMatch)\n\t\t{\n\t\t\tthis.toMatch = validate(toMatch);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof SObject)\n\t\t\t{\n\t\t\t\tSObject soArg = (SObject)arg;\n\t\t\t\tif (!sobjectMatches(soArg,this.toMatch))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate Map<Schema.SObjectField, Object> validate(Map<Schema.SObjectField, Object> arg)\n\t\t{\n\t\t\tif (arg == null || arg.isEmpty())\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Arg cannot be null/empty: ' + arg);\n\t\t\t}\n\n\t\t\treturn arg;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[SObject with fields ' + fflib_MatcherDefinitions.stringify(toMatch) + ']';\n\t\t}\n\t}\n\n\t/**\n\t* SObjectsWith matcher: compares the supplied list<Sobject> argument against a list<Map<Schema.SObjectField, Object>>, representing fields and their expected values.\n\t* Each list element represents one Sobject in a list supplied to a mocked method that accepts list<SObject>. \n\t* Each list element that is a map<Schema.SobjectField,Object> is compared against the equivalent argument list element position\n\t* \n\t* Example:\n\t*   You use uow.registerNew(someListofAccounts). You mock uow in the testmethod.\n\t*   toMatch is new list<Schema.SObjectField,Object> {\n\t*      new map<Schema.SobjectField,Object> {Account.Name => 'foo'},\n\t*      new map<Schema.SobjectField,Object> {Account.Name => 'bar'}\n\t*    } \n\t*   By default, matchers compare against argument elements in order, viz:\n\t* \t\tThe matcher will compare the first Account in the list passed to uow.registerNew to the first map of field values (i.e. Account[0].Name must be 'foo')\n\t*   \tThe matcher then compares the second Account in the list passed to uow.registerNew to the second map of field values (i.e. Account[1].Name must be 'bar')\n\t* \t\n\t*   Optional second argument matchInOrderr if false means that each argument element is compared against all matcher elements\n\t*   if everuy argument is matched exactly once and no matcher matches more than once, then the match is true\n\t* \n\t* If the arity of the list passed in the mocked method doesn't agree with the arity of the map of expected field values, false is returned\n\t* \n\t* Note. this method silently catches exceptions getting values for the supplied fields from the arguments supplied in method calls.\n\t* \n\t* If your matcher is mysteriously failing for your SObject record, it may be getting silent 'SObject row was retrieved via SOQL without querying\n\t* the requested field' exceptions, because you haven't queried all of the fields used in this matcher.\n\t*/\n\t@NamespaceAccessible\n\tpublic class SObjectsWith implements fflib_IMatcher\n\t{\n\t\tprivate list<Map<Schema.SObjectField, Object>> toMatch;\n\t\tprivate Boolean matchInOrder {\n\t\t\tget \n\t\t\t{\n\t\t\t\treturn matchInOrder == null ? false : matchInOrder;\n\t\t\t}\n\t\t\tset;\n\t\t}\n\n\t\t/**\n\t\t * SObjectsWith constructor\n\t\t * @param toMatch A list of maps of fields to their values to be compared. We compare each of these fields against the supplied list of sobject's field values.\n\t\t * @return fflib_MatcherDefinitions.SObjectWith A new SObjectWith instance\n\t\t */\n\t\tpublic SObjectsWith(list<Map<Schema.SObjectField, Object>> toMatch, Boolean matchInOrder)\n\t\t{\n\t\t\tthis.toMatch = validate(toMatch);\n\t\t\tthis.matchInOrder = matchInOrder;\n\t\t}\n\t\tpublic SObjectsWith(list<Map<Schema.SObjectField, Object>> toMatch)\n\t\t{\n\t\t\tthis.toMatch = validate(toMatch);\n\t\t\tthis.matchInOrder = true;\n\t\t}\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof list<SObject>)\n\t\t\t{\n\t\t\t\tSObject[] sobjsArg = (SObject[])arg;\n\t\t\t\tlist<map<Schema.SObjectField,Object>> toMatches = new list<map<Schema.SObjectField,Object>>();\n                \n\t\t\t\t//\tCounters for matchInOrder = false; not relevant for matchInOrder = true\n\t\t\t\tlist<Integer> argMatchedCounts = new list<Integer>();\t\t// # times matched by a matcher. anything other than 1 is match error\n\t\t\t\tlist<Integer> matcherMatchedCounts = new list<Integer>(); \t// for each map<Schema.SObjectField,Object>\n        \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// # args that match it. Anything other than 1 is match error\n                \n                \n\t\t\t\tfor (map<Schema.SObjectField,Object> mtchElm : toMatch)\n\t\t\t\t{\n\t\t\t\t\ttoMatches.add(mtchElm);\n\t\t\t\t\tmatcherMatchedCounts.add(0);\n\t\t\t\t}   \n                \n\t\t\t\tif (sobjsArg.size() != toMatches.size())\t// arity of arguments to mocked method doesn't agree with arity of expected matches\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n                \n\t\t\t\tif (matchInOrder)\n\t\t\t\t{\n\t\t\t\t\tfor (Integer i = 0; i < sobjsArg.size(); i++) \n\t\t\t\t\t{\t// match in order (toMatch[i] must match arg[i])\n\t\t\t\t\t\tif (!sobjectMatches(sobjsArg[i],toMatches[i]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\t// match in any order (but every arg must be matched only once)\n\t\t\t\t\tfor (Integer i = 0; i < sobjsArg.size(); i++) \n\t\t\t\t\t{\n\t\t\t\t\t\targMatchedCounts.add(0);\n\t\t\t\t\t\t// For each arg passed to mocked method, see if any match in the list of match field maps. \n\t\t\t\t\t\t// Loop within loop so not hugely efficient but there are no IDs to rely on.\n\t\t\t\t\t\t// Avoid unit test methods that build huge lists of expected results\n                         \n\t\t\t\t\t\tfor (Integer m = 0; m < toMatches.size(); m++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (sobjectMatches(sobjsArg[i],toMatches[m]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\targMatchedCounts[i] ++;\n\t\t\t\t\t\t\t\tmatcherMatchedCounts[m] ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Check to see that every arg was matched only once\n\t\t\t\t\t// Check to see that every matcher matched only once\n\t\t\t\t\t// Anything else is a match fail\n                    \n\t\t\t\t\tfor (Integer i=0; i < argMatchedCounts.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (argMatchedCounts[i] != 1 || matcherMatchedCounts[i] != 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}      \n\t\t\t\t\t}\n\t\t\t\t\treturn true;    \n\t\t\t\t}    \n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate list<Map<Schema.SObjectField, Object>> validate(list<Map<Schema.SObjectField, Object>> arg)\n\t\t{\n\t\t\tif (arg == null || arg.isEmpty() )\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Arg cannot be null/empty/other than list of map<Schema.SobjectField,Object>: ' + arg);\n\t\t\t}\n\n\t\t\treturn arg;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\tif (matchInOrder)\n\t\t\t{\n\t\t\t\treturn '[ordered SObjects with ' + fflib_MatcherDefinitions.stringify(toMatch) + ']';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '[unordered SObjects with ' + fflib_MatcherDefinitions.stringify(toMatch) + ']';\n\t\t\t}\n\t\t}\n        \n\n\t}    \n  \n    /**\n     * helper for the sObjectWith, sObjectsWith matchers\n     * Compares to see if the field values in toMatch exist in the sobj\n    **/\n    private static Boolean sObjectMatches(Sobject sobj, map<Schema.SobjectField,Object> toMatch)\n    {\n        for (Schema.SObjectField f : toMatch.keySet())\n        {\n            Object valueToMatch = toMatch.get(f);\n            \n            try\n            {\n                if (sobj.get(f) != valueToMatch)\n                {\n                    return false;\n                }\n            }\n            catch (Exception e)\n            {\n                //If we fail to get the value for a field it's either:\n                // - 'SObject row was retrieved via SOQL without querying the requested field' as a mismatch\n                // - System.SObjectException - Account.Id does not belong to SObject type Opportunity\n                //Don't care too much, just treat this as a mismatch.\n                return false;\n            }\n        }\n\t\treturn true;  // map of expected fieldvals found in sobj arg\n    }\n    \n\t/**\n\t * SObjectWithId matcher: checks if the supplied argument has the specified Id\n\t */\n\t@NamespaceAccessible\n\tpublic class SObjectWithId implements fflib_IMatcher\n\t{\n\t\tprivate Id toMatch;\n\n\t\t/**\n\t\t * SObjectWithId constructor\n\t\t * @param toMatch The Id to be compared\n\t\t * @return fflib_MatcherDefinitions.SObjectWithId A new SObjectWithId instance\n\t\t */\n\t\tpublic SObjectWithId(Id toMatch)\n\t\t{\n\t\t\tthis.toMatch = (Id)validateNotNull(toMatch);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof SObject)\n\t\t\t{\n\t\t\t\tSObject soArg = (SObject)arg;\n\t\t\t\treturn soArg.Id == toMatch;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[SObject with Id \"' + toMatch + '\"]';\n\t\t}\n\t}\n\n\t/**\n\t * SObjectWithName matcher: checks if the supplied argument has the specified Name\n\t@NamespaceAccessible\n\t */\n\tpublic class SObjectWithName implements fflib_IMatcher\n\t{\n\t\tprivate String toMatch;\n\n\t\t/**\n\t\t * SObjectWithName constructor\n\t\t * @param toMatch The name to be compared\n\t\t * @return fflib_MatcherDefinitions.SObjectWithName A new SObjectWithName instance\n\t\t */\n\t\tpublic SObjectWithName(String toMatch)\n\t\t{\n\t\t\tthis.toMatch = (String)validateNotNull(toMatch);\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\tif (arg != null && arg instanceof SObject)\n\t\t\t{\n\t\t\t\tSObject soArg = (SObject)arg;\t\n\t\t\t\tSchema.DescribeSObjectResult describe = soArg.getSObjectType().getDescribe();\n\t\t\t\tfor (Schema.SObjectField f : describe.fields.getMap().values())\n\t\t\t\t{\n\t\t\t\t\tif (f.getDescribe().isNameField())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn soArg.get(f) == toMatch;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[SObject with Name \"' + toMatch + '\"]';\n\t\t}\n\t}\n\n\t/*\n\t * STRING MATCHERS\n\t */\n\t\n\t/**\n\t * StringContains matcher: checks if the supplied argument contains the specified substring\n\t */\n\t@NamespaceAccessible\n\tpublic class StringContains implements fflib_IMatcher\n\t{\n\t\tprivate String toMatch;\n\t\t\n\t\t/**\n\t\t * StringContains constructor\n\t\t * @param toMatch The substring to be compared\n\t\t * @return fflib_MatcherDefinitions.StringContains A new StringContains instance\n\t\t */\n\t\tpublic StringContains(String toMatch)\n\t\t{\n\t\t\tthis.toMatch = (String)validateNotNull(toMatch);\n\t\t}\t\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof String ? ((String)arg).contains(toMatch) : false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[contains \"' + toMatch + '\"]';\n\t\t}\n\t}\n\n\t/**\n\t * StringEndsWith matcher: checks if the supplied argument ends with the specified substring\n\t */\n\t@NamespaceAccessible\n\tpublic class StringEndsWith implements fflib_IMatcher\n\t{\n\t\tprivate String toMatch;\n\t\t\n\t\t/**\n\t\t * StringEndsWith constructor\n\t\t * @param toMatch The substring to be compared\n\t\t * @return fflib_MatcherDefinitions.StringEndsWith A new StringEndsWith instance\n\t\t */\n\t\tpublic StringEndsWith(String toMatch)\n\t\t{\n\t\t\tthis.toMatch = (String)validateNotNull(toMatch);\n\t\t}\t\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof String ? ((String)arg).endsWith(toMatch) : false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[ends with \"' + toMatch + '\"]';\n\t\t}\n\t}\n\n\t/**\n\t * StringIsBlank matcher: checks if the supplied argument is a blank String\n\t@NamespaceAccessible\n\t */\n\tpublic class StringIsBlank implements fflib_IMatcher\n\t{\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg == null || (arg instanceof String ? String.isBlank((String)arg) : false);\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[blank String]';\n\t\t}\n\t}\n\n\t/**\n\t@NamespaceAccessible\n\t * StringIsNotBlank matcher: checks if the supplied argument is a non-blank string\n\t */\n\tpublic class StringIsNotBlank implements fflib_IMatcher\n\t{\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn (arg != NULL && arg instanceof String) ? String.isNotBlank((String)arg) : false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[non-blank String]';\n\t\t}\n\t}\n\n\t/**\n\t * StringMatches matcher: checks if the supplied argument matches the specified regex expression\n\t */\n\t@NamespaceAccessible\n\tpublic class StringMatches implements fflib_IMatcher\n\t{\n\t\tprivate Pattern pat;\n\t\tprivate final String regEx;\n\t\t\n\t\t/**\n\t\t * StringMatches constructor\n\t\t * @param toMatch The substring to be compared\n\t\t * @return fflib_MatcherDefinitions.StringMatches A new StringMatches instance\n\t\t */\n\t\tpublic StringMatches(String regEx)\n\t\t{\n\t\t\tthis.regEx = regEx;\n\t\t\tthis.pat = Pattern.compile((String)validateNotNull(regEx));\n\t\t}\t\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof String ? pat.matcher((String)arg).matches() : false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[matches regex \"' + regEx + '\"]';\n\t\t}\n\t}\n\n\t/**\n\t * StringStartsWith matcher: checks if the supplied argument starts with the specified substring\n\t */\n\t@NamespaceAccessible\n\tpublic class StringStartsWith implements fflib_IMatcher\n\t{\n\t\tprivate String toMatch;\n\t\t\n\t\t/**\n\t\t * StringStartsWith constructor\n\t\t * @param toMatch The substring to be compared\n\t\t * @return fflib_MatcherDefinitions.StringStartsWith A new StringStartsWith instance\n\t\t */\n\t\tpublic StringStartsWith(String toMatch)\n\t\t{\n\t\t\tthis.toMatch = (String)validateNotNull(toMatch);\n\t\t}\t\n\t\t\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg != null && arg instanceof String ? ((String)arg).startsWith(toMatch) : false;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '[starts with \"' + toMatch + '\"]';\n\t\t}\n\t}\n\n\t/*\n\t * Helpers\n\t */\n\n\tprivate static Object validateNotNull(Object arg)\n\t{\n\t\tif (arg == null)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('Arg cannot be null: ' + arg);\t\n\t\t}\n\t\t\n\t\treturn arg;\n\t}\n\n\tpublic static String stringify(Object value)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn JSON.serialize(value, false);\n\t\t}\n\t\tcatch (Exception error)\n\t\t{\n\t\t\treturn '' + value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MatcherDefinitions.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MatchersReturnValue.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@NamespaceAccessible\npublic with sharing class fflib_MatchersReturnValue\n{\n\tpublic List<fflib_IMatcher> matchers;\n\tpublic fflib_MethodReturnValue returnValue;\n\t\n\tpublic fflib_MatchersReturnValue(List<fflib_IMatcher> matchers, fflib_MethodReturnValue returnValue)\n\t{\n\t\tthis.matchers = matchers;\n\t\tthis.returnValue = returnValue;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MatchersReturnValue.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodArgValues.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@NamespaceAccessible\npublic with sharing class fflib_MethodArgValues\n{\n\tpublic List<Object> argValues;\n\t\n\t/**\n\t * Wrapper object which encapsulates the argument values\n\t * supplied during a given method call.\n\t * @param argValues The\n\t * @return fflib_MethodArgValues The method argument wrapper object\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodArgValues(List<Object> argValues)\n\t{\n\t\tthis.argValues = argValues;\n\t}\n\t\n\t/**\n\t * Standard equals override.\n\t * @param other The object whose equality we are verifying\n\t * @return Boolean True if meaningfully equivalent, false otherwise.\n\t */\n\tpublic Boolean equals(Object other)\n\t{\n\t\tif (this === other)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tfflib_MethodArgValues that = other instanceof fflib_MethodArgValues ? (fflib_MethodArgValues)other : null;\n\t\treturn that != null && this.argValues == that.argValues;\n\t}\n\t\n\t/**\n\t * Standard hashCode override.\n\t * @return Integer The generated hashCode\n\t */\n\tpublic Integer hashCode()\n\t{\n\t\tInteger prime = 31;\n\t\tInteger result = 1;\n\t\t\n\t\tresult = prime * result + ((argValues == null) ? 0 : argValues.hashCode());\n\t\t\n\t\treturn result;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodArgValues.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodCountRecorder.cls",
    "content": "/*\n Copyright (c) 2014-2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_MethodCountRecorder\n{\n\t/*\n\t * Map of method arguments by type name.\n\t *\n\t * Key: qualifiedMethod\n\t * Object: list of method arguments.\n\t *\n\t * Object: map of count by method call argument.\n\t */\n\tprivate static Map<fflib_QualifiedMethod, List<fflib_MethodArgValues>> methodArgumentsByTypeName =\n\t\tnew Map<fflib_QualifiedMethod, List<fflib_MethodArgValues>>();\n\n\tprivate static List<fflib_InvocationOnMock> orderedMethodCalls =\n\t\tnew List<fflib_InvocationOnMock>();\n\n\t/**\n\t * Getter for the list of the methods ordered calls.\n\t * @return The list of methods called in order.\n\t */\n\tpublic static List<fflib_InvocationOnMock> getOrderedMethodCalls()\n\t{\n\t\treturn orderedMethodCalls;\n\t}\n\n\t/**\n\t * Getter for the map of the method's calls with the related arguments.\n\t * @return The map of methods called with the arguments.\n\t */\n\tpublic static Map<fflib_QualifiedMethod, List<fflib_MethodArgValues>> getMethodArgumentsByTypeName()\n\t{\n\t\treturn methodArgumentsByTypeName;\n\t}\n\n\t/**\n\t * Record a method was called on a mock object.\n\t * @param invocation The object holding all the data of the invocation, like the method and arguments and the mock instance.\n\t */\n\tpublic void recordMethod(fflib_InvocationOnMock invocation)\n\t{\n\t\tList<fflib_MethodArgValues> methodArgs =\n\t\t\tmethodArgumentsByTypeName.get(invocation.getMethod());\n\n\t\tif (methodArgs == null)\n\t\t{\n\t\t\tmethodArgs = new List<fflib_MethodArgValues>();\n\t\t\tmethodArgumentsByTypeName.put(invocation.getMethod(), methodArgs);\n\t\t}\n\n\t\tmethodArgs.add(invocation.getMethodArgValues());\n\n\t\torderedMethodCalls.add(invocation);\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodCountRecorder.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodReturnValue.cls",
    "content": "/*\n * Copyright (c) 2014-2017, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * @group Core\n * Class defining a method return value.\n */\n@isTest\n@NamespaceAccessible\npublic with sharing class fflib_MethodReturnValue\n{\n\tprivate StandardAnswer basicAnswer = new StandardAnswer();\n\n\t/**\n\t * Instance of the implementation of the Answer interface that implements the answer,\n\t * if an answer isn't explicitly set the standard answer will be used, which just returns the stubbed return value.\n\t */\n\tpublic fflib_Answer Answer { get; set; }\n\n\t/**\n\t * Setup a stubbed return value.\n\t * @param value The value to return from the stubbed method call.\n\t * @return The fflib_MethodReturnValue instance to allow you to chain the methods.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodReturnValue thenReturn(Object value)\n\t{\n\t\tthenAnswer(this.basicAnswer.setValue(value));\n\t\treturn this;\n\t}\n\n\t/**\n\t * Setup a stubbed exception.\n\t * @param e The exception to throw from the stubbed method call.\n\t * @return The fflib_MethodReturnValue instance to allow you to chain the methods.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodReturnValue thenThrow(Exception e)\n\t{\n\t\tthenAnswer(this.basicAnswer.setValue(e));\n\t\treturn this;\n\t}\n\n\t/**\n\t * Setup a stubbed answer.\n\t * @param answer The answer to run from the stubbed method call.\n\t */\n\t@NamespaceAccessible\n\tpublic void thenAnswer(fflib_Answer answer)\n\t{\n\t\tthis.Answer = answer;\n\t}\n\n\t/**\n\t * Setup a list of stubbed return values.\n\t * @param values The values to return from the stubbed method call in consecutive calls.\n\t * @return The fflib_MethodReturnValue instance to allow you to chain the methods.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodReturnValue thenReturnMulti(List<Object> values)\n\t{\n\t\tthenAnswer(this.basicAnswer.setValues(values));\n\t\treturn this;\n\t}\n\n\t/**\n\t * Setup a list stubbed exceptions.\n\t * @param es The exceptions to throw from the stubbed method call in consecutive calls.\n\t * @return The fflib_MethodReturnValue instance to allow you to chain the methods.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_MethodReturnValue thenThrowMulti(List<Exception> es)\n\t{\n\t\tthenAnswer(this.basicAnswer.setValues(es));\n\t\treturn this;\n\t}\n\n\t/**\n\t * @group Core\n\t * Inner class to handle all the stubs that do not use the thenAnswer method directly.\n\t * For internal use only.\n\t */\n\t@NamespaceAccessible\n\tpublic class StandardAnswer implements fflib_Answer\n\t{\n\t\tprivate Integer whichStubReturnIndex = 0;\n\t\t/*\n\t\t * It stores the return values for the method stubbed.\n\t\t * The values would be stored and then returned as part of the standard answer invocation.\n\t\t */\n\t\tprivate List<Object> ReturnValues = new List<Object>();\n\n\t\t/**\n\t\t * Setter of a single return value.\n\t\t * @param value The value to be set as return value for the StandardAnswer object.\n\t\t * @return The StandardAnswer instance.\n\t\t */\n\t\tpublic StandardAnswer setValue(Object value)\n\t\t{\n\t\t\tReturnValues.add(value);\n\t\t\treturn this;\n\t\t}\n\n\t\t/**\n\t\t * Setter of the list of return values.\n\t\t * @param value The value to be set as return value for the StandardAnswer object.\n\t\t * @return the StandardAnswer instance.\n\t\t */\n\t\tpublic StandardAnswer setValues(List<Object> values)\n\t\t{\n\t\t\tif(values == null || values.size() == 0)\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n  \t\t\t\t\t'The stubbing is not correct, no return values have been set.');\n\t\t\t}\n\n\t\t\tReturnValues.addAll(values);\n\t\t\treturn this;\n\t\t}\n\n\t\t/**\n\t\t * Standard basic implementation for the fflib_Answer answer method, to be used as default answering.\n\t\t * @param invocation The invocation to answer for.\n\t\t * @return The ReturnValue for the method stubbed.\n\t\t */\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tif(ReturnValues == null || ReturnValues.size() == 0)\n\t\t\t{\n\t\t\t\tthrow new fflib_ApexMocks.ApexMocksException(\n  \t\t\t\t\t'The stubbing is not correct, no return values have been set.');\n\t\t\t}\n\n\t\t\tInteger returnValuesSize = ReturnValues.size()-1;\n\n\t\t\tif(whichStubReturnIndex < returnValuesSize)\n\t\t\t{\n\t\t\t\treturn ReturnValues[whichStubReturnIndex++];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn ReturnValues[returnValuesSize];\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodReturnValue.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodReturnValueRecorder.cls",
    "content": "/*\n * Copyright (c) 2014, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * @group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_MethodReturnValueRecorder\n{\n\tpublic Boolean Stubbing { get; set; }\n\n\tpublic List<Exception> DoThrowWhenExceptions { get; set; }\n\n\t/**\n\t * Map of matchers by method.\n\t *\n\t * Key: qualifiedMethod\n\t * Object: map of method return values by method.\n\t */\n\n\tprivate Map<fflib_QualifiedMethod, List<fflib_MatchersReturnValue>> matcherReturnValuesByMethod;\n\n\tpublic fflib_MethodReturnValue MethodReturnValue { get; private set; }\n\n\tpublic fflib_MethodReturnValueRecorder()\n\t{\n\t\tmatcherReturnValuesByMethod = new Map<fflib_QualifiedMethod, List<fflib_MatchersReturnValue>>();\n\n\t\tMethodReturnValue = null;\n\t}\n\n\t/**\n\t * Prepare a stubbed method return value.\n\t * @param invocation The object holding all the data of the invocation, like the method and arguments and the mock instance.\n\t * @return The MethodReturnValue instance.\n\t */\n\tpublic fflib_MethodReturnValue prepareMethodReturnValue(fflib_InvocationOnMock invocation)\n\t{\n\t\tMethodReturnValue = new fflib_MethodReturnValue();\n\n\t\tList<fflib_MatchersReturnValue> matcherReturnValues = matcherReturnValuesByMethod.get(invocation.getMethod());\n\t\tif (matcherReturnValues == null)\n\t\t{\n\t\t\tmatcherReturnValues = new List<fflib_MatchersReturnValue>();\n\t\t\tmatcherReturnValuesByMethod.put(invocation.getMethod(), matcherReturnValues);\n\t\t}\n\n\t\tList<Object> argValues = invocation.getMethodArgValues().argValues;\n\n\t\t//Register explicit arg values as 'equals' matchers, to preserve old behaviour\n\t\tif (!fflib_Match.Matching)\n\t\t{\n\t\t\tfor (Object arg : argValues)\n\t\t\t{\n\t\t\t\tif (arg == null)\n\t\t\t\t\tfflib_Match.isNull();\n\t\t\t\telse\n\t\t\t\t\tfflib_Match.eq(arg);\n\t\t\t}\n\t\t}\n\n\t\tList<fflib_IMatcher> matchers = fflib_Match.getAndClearMatchers(argValues.size());\n\t\tmatcherReturnValues.add(new fflib_MatchersReturnValue(matchers, MethodReturnValue));\n\n\t\treturn MethodReturnValue;\n\t}\n\n\t/**\n\t * Get the method return value for the given method call.\n\t * @param invocation The object holding all the data of the invocation, like the method and arguments and the mock instance.\n\t * @return The MethodReturnValue instance.\n\t */\n\tpublic fflib_MethodReturnValue getMethodReturnValue(fflib_InvocationOnMock invocation)\n\t{\n\t\tList<fflib_MatchersReturnValue> matchersForMethods = matcherReturnValuesByMethod.get(invocation.getMethod());\n\t\tif (matchersForMethods != null)\n\t\t{\n\t\t\tfor (Integer i = matchersForMethods.size() - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tfflib_MatchersReturnValue matchersReturnValue = (fflib_MatchersReturnValue)matchersForMethods.get(i);\n\t\t\t\tif (fflib_Match.matchesAllArgs(invocation.getMethodArgValues(), matchersReturnValue.matchers))\n\t\t\t\t{\n\t\t\t\t\treturn matchersReturnValue.ReturnValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Prepare a stubbed exceptions for a void method.\n\t * @param exps The list of exception to throw.\n\t */\n\tpublic void prepareDoThrowWhenExceptions(List<Exception> exps)\n\t{\n\t\tDoThrowWhenExceptions = exps;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodReturnValueRecorder.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodVerifier.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n *\tThis class implements the actual verification.\n *\t@group Core\n */\n@NamespaceAccessible\npublic abstract class fflib_MethodVerifier\n{\n\t/**\n\t * Verify a method was called on a mock object.\n\t * @param mockInvocation The object holding all the data of the invocation, like the method and arguments and the mock instance.\n\t * @param verificationMode The verification mode that holds the setting about how the verification should be performed.\n\t */\n\tpublic void verifyMethodCall(fflib_InvocationOnMock mockInvocation, fflib_VerificationMode verificationMode)\n\t{\n\t\tvalidateMode(verificationMode);\n\n\t\tverify(mockinvocation.getMethod(), mockinvocation.getMethodArgValues(), verificationMode);\n\t}\n\n\t/*\n\t * Method that actually performs the verify\n\t * @param qm The method to be verified.\n\t * @param methodArg The arguments of the method that needs to be verified.\n\t * @param verificationMode The verification mode that holds the setting about how the verification should be performed.\n\t */\n\tprotected abstract void verify(\n\t\tfflib_QualifiedMethod qm,\n\t\tfflib_MethodArgValues methodArg,\n\t\tfflib_VerificationMode verificationMode);\n\n\t/*\n\t * Method that validates the verification mode used in the verify.\n\t * Not all the methods from the fflib_VerificationMode are implemented for the different classes that extends the fflib_MethodVerifier.\n\t * The error is thrown at run time, so this method is called in the method that actually performs the verify.\n\t * @param verificationMode The verification mode that has to have been verified.\n\t * @throws Exception with message for the fflib_VerificationMode not implemented.\n\t */\n\tprotected abstract void validateMode(fflib_VerificationMode verificationMode);\n\n\t/*\n\t * Method that performs the argument capturing.\n\t * Captures argument values during verification.\n\t * @param matchers The list of matcher with which a method is verified.\n\t */\n\tprotected void capture(List<fflib_IMatcher> matchers)\n\t{\n\t\tfor(fflib_IMatcher matcher : matchers)\n\t\t{\n\t\t\tif( matcher instanceof fflib_ArgumentCaptor.AnyObject )\n\t\t\t{\n\t\t\t\t((fflib_ArgumentCaptor.AnyObject)matcher).storeArgument();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected void throwException(\n\t\tfflib_QualifiedMethod qm,\n\t\tString inOrder,\n\t\tInteger expectedCount,\n\t\tString qualifier,\n\t\tInteger methodCount,\n\t\tString customAssertMessage,\n\t\tfflib_MethodArgValues expectedArguments,\n\t\tList<fflib_IMatcher> expectedMatchers,\n\t\tList<fflib_MethodArgValues> actualArguments)\n\t{\n\t\tString template = 'EXPECTED COUNT: {0}{1}{2}' // qualified expected count (e.g. \"3 or fewer times in order\")\n\t\t\t+ '\\nACTUAL COUNT: {3}' // actual count\n\t\t\t+ '\\nMETHOD: {4}' // method signature\n\t\t\t+ '{5}'; // custom assert message\n\n\t\tString expectedDescription = '';\n\t\tString actualDescription = '';\n\n\t\tif (qm.hasArguments())\n\t\t{\n\t\t\ttemplate += '\\n---' // separator\n\t\t\t\t+ '\\nACTUAL ARGS: {6}' // actual args\n\t\t\t\t+ '\\n---' // separator\n\t\t\t\t+ '\\nEXPECTED ARGS: {7}'; // matcher descriptions \n\n\t\t\tif (expectedMatchers == null)\n\t\t\t{\n\t\t\t\texpectedDescription = describe(expectedArguments);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\texpectedDescription = describe(expectedMatchers);\n\t\t\t}\n\t\t\tactualDescription = describe(actualArguments);\n\t\t}\n\n\t\tString message = String.format(template, new List<String>{\n\t\t\t'' + expectedCount,\n\t\t\tString.isBlank(qualifier) ? '' : ('' + qualifier),\n\t\t\tinOrder,\n\t\t\t'' + methodCount,\n\t\t\t'' + qm,\n\t\t\tString.isBlank(customAssertMessage) ? '' : ('\\n' + customAssertMessage),\n\t\t\tactualDescription,\n\t\t\texpectedDescription\n\t\t});\n\n\t\tthrow new fflib_ApexMocks.ApexMocksException(message);\n\t}\n\n\tprivate static String describe(List<fflib_IMatcher> matchers)\n\t{\n\t\tList<String> descriptions = new List<String>();\n\t\tfor (fflib_IMatcher matcher : matchers)\n\t\t{\n\t\t\tdescriptions.add('' + matcher);\n\t\t}\n\n\t\treturn String.join(descriptions, ', ');\n\t}\n\n\tprivate static String describe(List<fflib_MethodArgValues> valuesFromAllInvocations)\n\t{\n\t\tList<String> descriptions = new List<String>();\n\t\tif (valuesFromAllInvocations != null)\n\t\t{\n\t\t\tfor (fflib_MethodArgValues valuesFromOneInvocation : valuesFromAllInvocations)\n\t\t\t{\n\t\t\t\tdescriptions.add(describe(valuesFromOneInvocation));\n\t\t\t}\n\t\t}\n\n\t\treturn '(' + String.join(descriptions, '), (') + ')';\n\t}\n\n\tprivate static String describe(fflib_MethodArgValues values)\n\t{\n\t\tList<String> descriptions = new List<String>();\n\t\tfor (Object value : values.argValues)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Attempt to JSON serialize - that way it doesn't truncate SObject fields etc.\n\t\t\t\t// Bear in mind that something are not JSON serializable, e.g. things with circular references.\n\t\t\t\tdescriptions.add(JSON.serialize(value));\n\t\t\t}\n\t\t\tcatch (Exception error)\n\t\t\t{\n\t\t\t\tdescriptions.add('' + value);\n\t\t\t}\n\t\t}\n\n\t\treturn String.join(descriptions, ', ');\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_MethodVerifier.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_QualifiedMethod.cls",
    "content": "/*\n * Copyright (c) 2016-2017 FinancialForce.com, inc.  All rights reserved.\n */\n@NamespaceAccessible\npublic with sharing class fflib_QualifiedMethod\n{\n\tpublic final Object mockInstance;\n\tpublic final String typeName;\n\tpublic final String methodName;\n\tpublic final List<Type> methodArgTypes;\n\t\n\t@NamespaceAccessible\n\tpublic fflib_QualifiedMethod(String typeName, String methodName, List<Type> methodArgTypes)\n\t{\n\t\tthis(typeName, methodName, methodArgTypes, null);\n\t}\n\n\t@NamespaceAccessible\n\tpublic fflib_QualifiedMethod(String typeName, String methodName, List<Type> methodArgTypes, Object mockInstance)\n\t{\n\t\tthis.mockInstance = mockInstance;\n\t\tthis.typeName = typeName;\n\t\tthis.methodName = methodName;\n\t\tthis.methodArgTypes = methodArgTypes;\t\n\t}\n\t\n\t/**\n\t * Standard equals override.\n\t * @param other The object whose equality we are verifying\n\t * @return Boolean True if meaningfully equivalent, false otherwise.\n\t */\n\tpublic Boolean equals(Object other)\n\t{\n\t\tif (this === other)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tfflib_QualifiedMethod that = other instanceof fflib_QualifiedMethod ? (fflib_QualifiedMethod)other : null;\n\t\t\n\t\treturn that != null\n\t\t\t&& (this.mockInstance === that.mockInstance || !fflib_ApexMocksConfig.HasIndependentMocks)\n\t\t\t&& this.typeName == that.typeName\n\t\t\t&& this.methodName == that.methodName\n\t\t\t&& this.methodArgTypes == that.methodArgTypes;\n\t}\n\t\n\t/**\n\t * Standard hashCode override.\n\t * @return Integer The generated hashCode\n\t */\n\tpublic Integer hashCode()\n\t{\n\t\tInteger prime = 31;\n\t\tInteger result = 1;\n\t\t\n\t\tif (fflib_ApexMocksConfig.HasIndependentMocks)\n\t\t{\n\t\t\tresult = prime * result + ((mockInstance == null) ? 0 : mockInstance.hashCode());\n\t\t}\n\t\tresult = prime * result + ((methodArgTypes == null) ? 0 : methodArgTypes.hashCode());\n\t\tresult = prime * result + ((methodName == null) ? 0 : methodName.hashCode());\n\t\tresult = prime * result + ((typeName == null) ? 0 : typeName.hashCode());\n\t\t\n\t\treturn result;\n\t}\n\t\n\t/**\n\t * Standard toString override.\n\t * @return String The human friendly description of the method.\n\t */\n\tpublic override String toString()\n\t{\n\t\treturn typeName + '.' + methodName + methodArgTypes;\n\t}\n\n\t/**\n\t * Predicate describing whether the qualified method accepts arguments or not.\n\t * @return True if the method accepts arguments.\n\t */\n\tpublic Boolean hasArguments()\n\t{\n\t\treturn this.methodArgTypes != null && !this.methodArgTypes.isEmpty();\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_QualifiedMethod.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_QualifiedMethodAndArgValues.cls",
    "content": "/*\n Copyright (c) 2016-2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_QualifiedMethodAndArgValues\n{\n\tprivate final fflib_QualifiedMethod qm;\n\tprivate final fflib_MethodArgValues args;\n\tprivate final Object mockInstance;\n\n\t@NamespaceAccessible\n\tpublic fflib_QualifiedMethodAndArgValues(fflib_QualifiedMethod qm, fflib_MethodArgValues args, Object mockInstance)\n\t{\n\t\tthis.qm = qm;\n\t\tthis.args = args;\n\t\tthis.mockInstance = mockInstance;\n\t}\n\n\t@NamespaceAccessible\n\tpublic fflib_QualifiedMethod getQualifiedMethod()\n\t{\n\t\treturn qm;\n\t}\n\n\t@NamespaceAccessible\n\tpublic fflib_MethodArgValues getMethodArgValues()\n\t{\n\t\treturn args;\n\t}\n\n\t@NamespaceAccessible\n\tpublic Object getMockInstance()\n\t{\n\t\treturn mockInstance;\n\t}\n\n\tpublic override String toString()\n\t{\n\t\treturn qm + ' with args: [' + String.join(args.argValues, '],[') + ']';\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_QualifiedMethodAndArgValues.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_System.cls",
    "content": "/*\n * Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @group Core\n * Contains counterparts for helper methods in the native System class.\n */\n\n@NamespaceAccessible\npublic class fflib_System\n{\n\t/**\n\t * Verifies that the supplied argument is meaningfully equivalent to the expected argument, as defined by its matcher.\n\t * See fflib_SystemTest for examples of usage.\n\t * @param ignoredRetval Dummy value, returned on registering an fflib_IMatcher.\n\t * @param value         The object instance upon which we are checking equality.\n\t */\n\t@NamespaceAccessible\n\tpublic static void assertEquals(Object ignoredRetval, Object value)\n\t{\n\t\tassertEquals(ignoredRetval, value, null);\n\t}\n\n\t/**\n\t * Verifies that the supplied argument is meaningfully equivalent to the expected argument, as defined by its matcher.\n\t * See fflib_SystemTest for examples of usage.\n\t * @param ignoredRetval Dummy value, returned on registering an fflib_IMatcher.\n\t * @param value         The object instance upon which we are checking equality.\n\t * @param customAssertMessage Provides context or additional information for the assertion.\n\t */\n\t@NamespaceAccessible\n\tpublic static void assertEquals(Object ignoredRetval, Object value, String customAssertMessage)\n\t{\n\t\tfflib_IMatcher matcher = null;\n\t\ttry\n\t\t{\n\t\t\tList<fflib_IMatcher> matchers = fflib_Match.getAndClearMatchers(1);\n\t\t\tmatcher = matchers[0];\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('fflib_System.assertEquals expects you to register exactly 1 fflib_IMatcher (typically through the helpers in fflib_Match).');\n\t\t}\n\t\t\n\t\tif (!matcher.matches(value))\n\t\t{\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException(String.format('Expected : {0}, Actual: {1}{2}', new String[]{\n\t\t\t\tString.valueOf(matcher),\n\t\t\t\tString.valueOf(value),\n\t\t\t\tString.isBlank(customAssertMessage) ? '' : (' -- ' + customAssertMessage)\n\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_System.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_VerificationMode.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n *\tThis class implements the verification modes with Mockito syntax style.\n *\tIt can be used in the classic verify and in the ordered verify.\n *\t@group Core\n */\n@NamespaceAccessible\npublic with sharing class fflib_VerificationMode\n{\n\tpublic Integer VerifyMin {get; set;}\n\tpublic Integer VerifyMax {get; set;}\n\tpublic String CustomAssertMessage { get; set; }\n\n\tpublic enum ModeName {times, atLeast, atMost, between, atLeastOnce, calls}\n\n\tpublic ModeName Method;\n\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode()\n\t{\n\t\tVerifyMin = 1;\n\t\tVerifyMax = null;\n\t\tCustomAssertMessage = null;\n\t\tMethod = null;\n\t}\n\n\t/**\n\t* Sets how many times the method is expected to be called.\n\t  * For InOrder verification we copy Mockito behavior which is as follows;\n\t * <ul>\n\t * <li>Consume the specified number of matching invocations, ignoring non-matching invocations in between</li>\n\t * <li>Fail an assert if the very next invocation matches, but additional matches can still exist so long as at least one non-matching invocation exists before them</li>\n\t * </ul>\n\t * For example if you had a(); a(); b(); a();\n\t * then inOrder.verify(myMock, 2)).a(); or inOrder.verify(myMock, 3)).a(); would pass but not inOrder.verify(myMock, 1)).a();\n\t * @param times The number of times you expect the method to have been called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode times(Integer times)\n\t{\n\t\tthis.Method = ModeName.times;\n\t\tthis.VerifyMin = this.VerifyMax = times;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets a custom assert message for the verify.\n\t * @param customAssertMessage The custom message for the assert in case the assert is false. The custom message is queued to the default message.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode description(String customAssertMessage)\n\t{\n\t\tthis.CustomAssertMessage = customAssertMessage;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum number of times the method is expected to be called.\n\t * With the InOrder verification it performs a greedy verification, which means it would consume all the instances of the method verified.\n\t * @param atLeastTimes The minimum number of times you expect the method to have been called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode atLeast(Integer atLeastTimes)\n\t{\n\t\tthis.Method = ModeName.atLeast;\n\t\tthis.VerifyMin = atLeastTimes;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the maximum number of times the method is expected to be called. Not available in the InOrder verification.\n\t * @param atMostTimes The maximum number of times the method is expected to be called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode atMost(Integer atMostTimes)\n\t{\n\t\tthis.Method = ModeName.atMost;\n\t\tthis.VerifyMax = atMostTimes;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets that the method is called at least once.\n\t * With the InOrder verification it performs a greedy verification, which means it would consume all the instances of the method verified.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode atLeastOnce()\n\t{\n\t\tthis.Method = ModeName.atLeastOnce;\n\t\tthis.VerifyMin = 1;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the range of how many times the method is expected to be called. Not available in the InOrder verification.\n\t * @param atLeastTimes The minimum number of times you expect the method to have been called.\n\t * @param atMostTimes The maximum number of times the method is expected to be called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode between(Integer atLeastTimes, Integer atMostTimes)\n\t{\n\t\tthis.Method = ModeName.between;\n\t\tthis.VerifyMin = atLeastTimes;\n\t\tthis.VerifyMax = atMostTimes;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets that the method is not expected to be called.\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode never()\n\t{\n\t\tthis.VerifyMin = fflib_ApexMocks.NEVER;\n\t\tthis.VerifyMax = fflib_ApexMocks.NEVER;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets how many times the method is expected to be called for an InOrder verifier. Available Only with the InOrder verification.\n\t * A verification mode using calls will not fail if the method is called more times than expected.\n\t * @param callingTimes The number of times you expect the method to have been called in the InOrder verifying (no greedy verify).\n\t * @return The fflib_VerificationMode object instance with the proper settings.\n\t */\n\t@NamespaceAccessible\n\tpublic fflib_VerificationMode calls(Integer callingTimes)\n\t{\n\t\tthis.Method = ModeName.calls;\n\t\tthis.VerifyMin = callingTimes;\n\t\tthis.VerifyMax = null;\n\n\t\treturn this;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/main/classes/fflib_VerificationMode.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_AnswerTest.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @nodoc\n */\n@isTest\nprivate class fflib_AnswerTest\n{\n\n\tprivate static fflib_InvocationOnMock actualInvocation = null;\n\n\t@isTest\n\tstatic void thatAnswersWithException()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.ExceptionForAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.get2(0, 'Hi hi Hello Hi hi');\n\t\t\tSystem.Assert.fail('an exception is expected to be thrown on the answer execution');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ansExpt)\n\t\t{\n\t\t\tString expectedMessage = 'an error occurs on the execution of the answer';\n\t\t\t// Then\n\t\t\tSystem.Assert.areEqual(expectedMessage, ansExpt.getMessage(), 'the message from the answer is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatStoresMethodIntoInvocationOnMock()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.BasicAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tmockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\t// Then\n\n\t\tObject methodCalled = actualInvocation.getMethod();\n\t\tSystem.Assert.isInstanceOfType(methodCalled, fflib_QualifiedMethod.class, 'the object returned is not a method as expected');\n\n\t\tString expectedMethodSignature = fflib_MyList.getStubClassName() + '.get2(Integer, String)';\n\t\tSystem.Assert.areEqual(expectedMethodSignature, ((fflib_QualifiedMethod)methodCalled).toString(), ' the method is no the one expected');\n\t}\n\n\t@isTest\n\tstatic void thatAnswerOnlyForTheMethodStubbedWithAnswer()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(3)).thenReturn('ted');\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.BasicAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tmockList.add('one');\n\t\tString noAnswered = mockList.get(3);\n\t\tmockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tObject methodCalled = actualInvocation.getMethod();\n\t\tSystem.Assert.isInstanceOfType(methodCalled, fflib_QualifiedMethod.class, 'the object returned is not a method as expected');\n\n\t\tString expectedMethodSignature = fflib_MyList.getStubClassName() + '.get2(Integer, String)';\n\t\tSystem.Assert.areEqual(expectedMethodSignature, ((fflib_QualifiedMethod)methodCalled).toString(), ' the method is no the one expected');\n\n\t\tSystem.Assert.areEqual('ted', noAnswered, 'the get method should have returned the stubbed string');\n\t}\n\n\t@isTest\n\tstatic void thatMultipleAnswersAreHandled()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(3)).thenAnswer(new fflib_AnswerTest.FirstAnswer());\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.SecondAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tmockList.add('one');\n\t\tString answer1 = mockList.get(3);\n\t\tString answer2 = mockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\tSystem.Assert.areEqual('this is the first answer', answer1, 'the answer wasnt the one expected');\n\t\tSystem.Assert.areEqual('and this is the second one', answer2, 'the answer wasnt the one expected');\n\t}\n\n\t@isTest\n\tstatic void thatStoresMockInstanceIntoInvocationOnMock()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.BasicAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString mockCalled = mockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tSystem.Assert.isInstanceOfType(actualInvocation.getMock(), fflib_MyList.IList.class, 'the object returned is not a mock instance as expected');\n\t\tSystem.Assert.areEqual(mockList, actualInvocation.getMock(), 'the mock returned should be the mockList used in the stubbing');\n\t}\n\n\t@isTest\n\tstatic void thatMethodsParametersAreAccessible()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.ProcessArgumentAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('Bye hi Hello Bye hi', actualValue, 'the answer is not correct');\n\t}\n\n\t@isTest\n\tstatic void thatAnswerOnlyForTheStubbedParameter()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.ProcessArgumentAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue1 = mockList.get2(0, 'some string for my method');\n\t\tString actualValue2 = mockList.get2(0, 'Hi hi Hello Hi hi');\n\t\tString actualValue3 = mockList.get2(0, 'another string for the same method');\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('Bye hi Hello Bye hi', actualValue2, 'the answer is not correct');\n\t\tSystem.Assert.areEqual(null, actualValue1, 'the answer is not correct');\n\t\tSystem.Assert.areEqual(null, actualValue3, 'the answer is not correct');\n\t}\n\n\t@isTest\n\tstatic void thatMethodsParametersAreAccessibleWhenCalledWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(fflib_Match.anyInteger(), fflib_Match.anyString())).thenAnswer(new fflib_AnswerTest.ProcessArgumentAnswer());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('Bye hi Hello Bye hi', actualValue, 'the answer is not correct');\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsThrownWhenAccessOutOfIndexArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.ExceptionForArgumentsOutOfBound());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get2(0, 'Hi hi Hello Hi hi');\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsThrownWhenAccessNegativeIndexArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'Hi hi Hello Hi hi')).thenAnswer(new fflib_AnswerTest.ExceptionForNegativeArgumentIndex());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get2(0, 'Hi hi Hello Hi hi');\n\t}\n\n\t@isTest\n\tstatic void thatArgumentListEmptyForMethodWithNoArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.isEmpty()).thenAnswer(new fflib_AnswerTest.ArgumentListEmptyForMethodWithNoArgument());\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tBoolean actualValue = mockList.isEmpty();\n\t}\n\n\t@isTest\n\tstatic void thatAnswerToVoidMethod()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList) mocks.doAnswer(new fflib_AnswerTest.BasicAnswer(), mockList)).addMore('Hi hi Hello Hi hi');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tmockList.addMore('Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tObject methodCalled = actualInvocation.getMethod();\n\t\tSystem.Assert.isInstanceOfType(methodCalled, fflib_QualifiedMethod.class, 'the object returned is not a method as expected');\n\n\t\tString expectedMethodSignature = fflib_MyList.getStubClassName() + '.addMore(String)';\n\t\tSystem.Assert.areEqual(expectedMethodSignature, ((fflib_QualifiedMethod)methodCalled).toString(), 'Unexpected method name: ' + methodCalled);\n\t}\n\n\t@isTest\n\tstatic void thatAnswerToVoidAndNotVoidMethods()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList) mocks.doAnswer(new fflib_AnswerTest.FirstAnswer(), mockList)).get(3);\n\t\t((fflib_MyList) mocks.doAnswer(new fflib_AnswerTest.BasicAnswer(), mockList)).addMore('Hi hi Hello Hi hi');\n\t\t((fflib_MyList) mocks.doAnswer(new fflib_AnswerTest.SecondAnswer(), mockList)).get2(4, 'Hi hi Hello Hi hi');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString answer1 = mockList.get(3);\n\t\tString answer2 = mockList.get2(4, 'Hi hi Hello Hi hi');\n\t\tmockList.addMore('Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tObject methodCalled = actualInvocation.getMethod();\n\t\tSystem.Assert.isInstanceOfType(methodCalled, fflib_QualifiedMethod.class, 'the object returned is not a method as expected');\n\n\t\tString expectedMethodSignature = fflib_MyList.getStubClassName() + '.addMore(String)';\n\t\tSystem.Assert.areEqual(expectedMethodSignature, ((fflib_QualifiedMethod)methodCalled).toString(),\n\t\t\t'the last method called should be the addMore, so should be the last to set the actualInvocation variable.');\n\n\t\tSystem.Assert.areEqual('this is the first answer', answer1, 'the answer was not the one expected');\n\t\tSystem.Assert.areEqual('and this is the second one', answer2, 'the answer was not the one expected');\n\t}\n\n\t@isTest\n\tstatic void thatAnswerToDifferentVoidMethods()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tfflib_AnswerTest.FirstAnswer answer1 = new fflib_AnswerTest.FirstAnswer();\n\t\tfflib_AnswerTest.SecondAnswer answer2 = new fflib_AnswerTest.SecondAnswer();\n\n\t\tSystem.Assert.areEqual(null, answer1.getMessage(), 'the answer message should be null at this stage');\n\t\tSystem.Assert.areEqual(null, answer2.getMessage(), 'the answer message should be null at this stage');\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList) mocks.doAnswer(answer1, mockList)).addMore('Hi hi Hello Hi hi');\n\t\t((fflib_MyList) mocks.doAnswer(answer2, mockList)).add('Hello');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tmockList.addMore('Hi hi Hello Hi hi');\n\t\tmockList.add('Hello');\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('this is the first answer', answer1.getMessage(), 'the answer was not the one expected');\n\t\tSystem.Assert.areEqual('and this is the second one', answer2.getMessage(), 'the answer was not the one expected');\n\t}\n\n\t//Answers\n\n\tpublic class BasicAnswer implements fflib_Answer\n\t{\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class ExceptionForAnswer implements fflib_Answer\n\t{\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\tthrow new fflib_ApexMocks.ApexMocksException('an error occurs on the execution of the answer');\n\t\t}\n\t}\n\n\tpublic class ExceptionForArgumentsOutOfBound implements fflib_Answer\n\t{\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tObject noExistingObj = invocation.getArgument(2);\n\t\t\t\tSystem.Assert.fail('an exception was expected because the argument in the method are only 2');\n\t\t\t}\n\t\t\tcatch(fflib_ApexMocks.ApexMocksException exp)\n\t\t\t{\n\t\t\t\tString expectedMessage = 'Invalid index, must be greater or equal to zero and less of 2.';\n\t\t\t\tString actualMessage = exp.getMessage();\n\t\t\t\tSystem.Assert.areEqual(expectedMessage, actualMessage, 'the message return by the exception is not as expected');\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class ExceptionForNegativeArgumentIndex implements fflib_Answer\n\t{\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tObject noExistingObj = invocation.getArgument(-1);\n\t\t\t\tSystem.Assert.fail('an exception was expected because the argument index cannot be negative');\n\t\t\t}\n\t\t\tcatch(fflib_ApexMocks.ApexMocksException exp)\n\t\t\t{\n\t\t\t\tString expectedMessage = 'Invalid index, must be greater or equal to zero and less of 2.';\n\t\t\t\tString actualMessage = exp.getMessage();\n\t\t\t\tSystem.Assert.areEqual(expectedMessage, actualMessage, 'the message return by the exception is not as expected');\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class ArgumentListEmptyForMethodWithNoArgument implements fflib_Answer\n\t{\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\tList<Object> emptyList = invocation.getArguments();\n\n\t\t\tSystem.Assert.areEqual(0, emptyList.size(), 'the argument list from a method without arguments should be empty');\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class FirstAnswer implements fflib_Answer\n\t{\n\t\tprivate String answerMessage;\n\n\t\tpublic String getMessage()\n\t\t{\n\t\t\treturn this.answerMessage;\n\t\t}\n\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\tthis.answerMessage = 'this is the first answer';\n\n\t\t\treturn answerMessage;\n\t\t}\n\t}\n\n\tpublic class SecondAnswer implements fflib_Answer\n\t{\n\t\tprivate String answerMessage;\n\n\t\tpublic String getMessage()\n\t\t{\n\t\t\treturn this.answerMessage;\n\t\t}\n\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\tthis.answerMessage = 'and this is the second one';\n\n\t\t\treturn answerMessage;\n\t\t}\n\t}\n\n\tpublic class ProcessArgumentAnswer implements fflib_Answer\n\t{\n\t\tpublic Object answer(fflib_InvocationOnMock invocation)\n\t\t{\n\t\t\tactualInvocation = invocation;\n\n\t\t\tString argument = (String) invocation.getArgument(1);\n\t\t\tSystem.Assert.areNotEqual(null, argument, ' the argument should have some value');\n\t\t\targument = argument.replace('Hi', 'Bye');\n\t\t\treturn argument;\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_AnswerTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_AnyOrderTest.cls",
    "content": "/*\n Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @nodoc\n */\n@isTest\nprivate class fflib_AnyOrderTest\n{\n\t/*\n\t *\treplicating the apex mocks tests with the new syntax\n\t */\n\n\t@isTest\n\tprivate static void whenVerifyMultipleCallsWithMatchersShouldReturnCorrectMethodCallCounts()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add(fflib_Match.anyString());\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('fred');\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(fflib_Match.stringContains('fred'));\n\t}\n\n\t@isTest\n\tprivate static void whenVerifyWithCombinedMatchersShouldReturnCorrectMethodCallCounts()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add(\n\t\t\t(String)fflib_Match.allOf(fflib_Match.eq('bob'), fflib_Match.stringContains('re'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(\n\t\t\t(String)fflib_Match.allOf(fflib_Match.eq('fred'), fflib_Match.stringContains('re'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add(\n\t\t\t(String)fflib_Match.anyOf(fflib_Match.eq('bob'), fflib_Match.eq('fred'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(\n\t\t\t(String)fflib_Match.anyOf(fflib_Match.eq('bob'), fflib_Match.eq('jack'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add(\n\t\t\t(String)fflib_Match.noneOf(fflib_Match.eq('jack'), fflib_Match.eq('tim'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add(\n\t\t\t(String)fflib_Match.noneOf(\n\t\t\t\tfflib_Match.anyOf(fflib_Match.eq('jack'), fflib_Match.eq('jill')),\n\t\t\t\tfflib_Match.allOf(fflib_Match.eq('tim'), fflib_Match.stringContains('i'))\n\t\t\t)\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add(\n\t\t\t(String)fflib_Match.isNot(fflib_Match.eq('jack'))\n\t\t);\n\t}\n\n\t@isTest\n\tprivate static void whenVerifyCustomMatchersCanBeUsed()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.get(1);\n\t\tmockList.get(2);\n\t\tmockList.get(3);\n\t\tmockList.get(4);\n\t\tmockList.get(5);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(3))).get((Integer)fflib_Match.matches(new isOdd()));\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).get((Integer)fflib_Match.matches(new isEven()));\n\t}\n\n\t@isTest\n\tprivate static void verifyMultipleMethodCallsWithSameSingleArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void verifyMethodNotCalled()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.get(0);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add('bob');\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).get(0);\n\t}\n\n\t@isTest\n\tprivate static void verifySingleMethodCallWithMultipleArguments()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.set(0, 'bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).set(0, 'bob');\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).set(0, 'fred');\n\t}\n\n\t@isTest\n\tprivate static void verifyMethodCallWhenNoCallsBeenMadeForType()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void whenVerifyMethodNeverCalledMatchersAreReset()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).get(fflib_Match.anyInteger());\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(fflib_Match.anyString());\n\t}\n\n\t/*\n\t *\ttimes\n\t */\n\n\t@isTest\n\tprivate static void verifyTimesMethodHasBeenCalled()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(3))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void verifyTimesMethodHasBeenCalledWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob1');\n\t\tmockList.add('bob2');\n\t\tmockList.add('bob3');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(3))).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatVerifyTimesMethodFailsWhenCalledLessTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(4))).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tassertFailMessage(exc.getMessage(), 4, 3);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifyTimesMethodFailsWhenCalledMoreTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tassertFailMessage(exc.getMessage(), 2, 3);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifyTimesMethodFailsWhenCalledLessTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(4))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tassertFailMessage(exc.getMessage(), 4, 3);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifyTimesMethodFailsWhenCalledMoreTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tassertFailMessage(exc.getMessage(), 2, 3);\n\t\t}\n\t}\n\n\t/*\n\t *\tdescription\n\t */\n\n\t@isTest\n\tprivate static void thatCustomMessageIsAdded()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\tString customAssertMessage = 'Custom message to explain the reason of the verification';\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.times(2).description(customAssertMessage))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 2'\n\t\t\t\t+ '\\nACTUAL COUNT: 3'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\nCustom message to explain the reason of the verification'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"bob\"), (\"bob\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [any String]',\n\t\t\t\texc.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t/*\n\t *\tatLeast\n\t */\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeast(2))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastNumberOfTimesWhenIsCalledMoreTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeast(2))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledLessThanAtLeastNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeast(3))).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called 3 times when instead is called only twice');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 3 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 2'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"bob\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"bob\"',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeast(2))).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastNumberOfTimesWhenIsCalledMoreTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeast(2))).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledLessThanAtLeastNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeast(3))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called 3 times when instead is called only twice');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 3 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 2'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [any String]',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t/*\n\t *\tatMost\n\t */\n\n\t@isTest\n\tprivate static void thatVerifiesAtMostNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atMost(5))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtMostSameNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atMost(3))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledMoreThanAtMostNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atMost(3))).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called 3 times when instead is called four times');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 3 or fewer times'\n\t\t\t\t+ '\\nACTUAL COUNT: 4'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"fred\"), (\"bob\"), (\"bob\"), (\"bob\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"bob\"',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtMostNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atMost(5))).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtMostSameNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atMost(3))).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledMoreThanAtMostNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atMost(3))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called 3 times when instead is called four times');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 3 or fewer times'\n\t\t\t\t+ '\\nACTUAL COUNT: 4'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"fred\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [any String]'\n\t\t\t\t, ex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t/*\n\t *\tatLeastOnce\n\t */\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceNumberOfTimesWhenIsCalledMoreTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledLessThanAtLeastOnceNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('rob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called at least once when instead is never called');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"rob\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"bob\"',\n\t\t\t\tex.getmessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceNumberOfTimesWhenIsCalledMoreTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledLessThanAtLeastOnceNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called at lest once when instead is never called');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: ()'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [any String]',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t/*\n\t *\tbetween\n\t */\n\n\t@isTest\n\tprivate static void thatVerifiesBetweenNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.between(3, 5))).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatBetweenThrownExceptionIfCalledLessThanAtLeastNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.between(3, 5))).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called at least 3 times when instead is called only twice');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 3 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 2'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"bob\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"bob\"',\n\t\t\t\tex.getMessage()\n\t\t\t);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesBetweenNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.between(3, 5))).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatBetweenThrownExceptionIfCalledLessThanAtLeastNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.between(3, 5))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called 3 times when instead is called only twice');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 3 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 2'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [any String]',\n\t\t\t\tex.getMessage()\n\t\t\t);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatBetweenThrownExceptionIfCalledMoreThanAtMostNumberOfTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.between(3, 5))).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called at most 5 times when instead is called six times');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 5 or fewer times'\n\t\t\t\t+ '\\nACTUAL COUNT: 6'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"fred\"), (\"bob\"), (\"bob\"), (\"bob\"), (\"bob\"), (\"bob\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"bob\"',\n\t\t\t\tex.getMessage()\n\t\t\t);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatBetweenThrownExceptionIfCalledMoreThanAtMostNumberOfTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.between(3, 5))).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called 5 times when instead is called six times');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 5 or fewer times'\n\t\t\t\t+ '\\nACTUAL COUNT: 6'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"bob\"), (\"fred\"), (\"fred\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [any String]',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t/*\n\t *\tnever\n\t */\n\n\t@isTest\n\tprivate static void verifyNeverMethodHasNotBeenCalled()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob1');\n\t\tmockList.add('bob2');\n\t\tmockList.add('bob3');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void verifyNeverMethodHasBeenNotCalledWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\t\tmockList.add('fred', 'fred', 'fred', 'fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatVerifyNeverFailsWhenCalledMoreTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add('bob');\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tassertFailMessage(exc.getMessage(), 0, 2);\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifyNeverFailsWhenCalledMoreTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.never())).add(fflib_Match.anyString());\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(Exception exc)\n\t\t{\n\t\t\tassertFailMessage(exc.getMessage(), 0, 3);\n\t\t}\n\t}\n\n\n\n\t/*\n\t *\tatLeastOnce\n\t */\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnce()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceWhenIsCalledMoreTimes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add('bob');\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledLessThanAtLeastOnce()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add('rob');\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called one times when instead is not called');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\"), (\"bob\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"rob\"',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatVerifiesAtLeastOnceWhenIsCalledMoreTimesWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tprivate static void thatThrownExceptionIfCalledLessThanAtLeastOnceWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList, mocks.atLeastOnce())).add(fflib_Match.stringStartsWith('rob'));\n\n\t\t\tSystem.Assert.fail('an exception was expected because we are asserting that the method is called once when instead is not called');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException ex)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 or more times'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"bob\"), (\"fred\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [starts with \"rob\"]',\n\t\t\t\tex.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t/*\n\t *\tHELPER METHODS\n\t */\n\n\tprivate static void assertFailMessage(String exceptionMessage, Integer expectedInvocations, Integer actualsInvocations)\n\t{\n\t\tSystem.Assert.isTrue(\n\t\t\texceptionMessage.startsWith('EXPECTED COUNT: ' + expectedInvocations + '\\nACTUAL COUNT: ' + actualsInvocations),\n\t\t\t'Unexpected verify fail message: ' + exceptionMessage\n\t\t);\n\t}\n\n\t/*\n\t *\tHELPER CLASSES\n\t */\n\n\tprivate class isOdd implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg instanceof Integer ? Math.mod((Integer)arg, 2) == 1: false;\n\t\t}\n\t}\n\n\tprivate class isEven implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg instanceof Integer ? Math.mod((Integer)arg, 2) == 0: false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_AnyOrderTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_ApexMocksTest.cls",
    "content": "/*\n * Copyright (c) 2014-2017 FinancialForce.com, inc.  All rights reserved.\n */\n@isTest\nprivate class fflib_ApexMocksTest\n{\n\tprivate static final fflib_ApexMocks MY_MOCKS = new fflib_ApexMocks();\n\tprivate static final fflib_MyList MY_MOCK_LIST = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\n\t@isTest\n\tstatic void whenStubMultipleCallsWithMatchersShouldReturnExpectedValues()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(fflib_Match.anyInteger(), fflib_Match.anyString())).thenReturn('any');\n\t\tmocks.when(mockList.get2(fflib_Match.anyInteger(), fflib_Match.stringContains('Hello'))).thenReturn('hello');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get2(0, 'Hi hi Hello Hi hi');\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('hello', actualValue);\n\t}\n\n\t@isTest\n\tstatic void whenVerifyMultipleCallsWithMatchersShouldReturnCorrectMethodCallCounts()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add(fflib_Match.anyString());\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('fred');\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(fflib_Match.stringContains('fred'));\n\t}\n\n\t@isTest\n\tstatic void whenStubExceptionWithMatchersShouldThrowException()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList.IList) mocks.doThrowWhen(new MyException('Matcher Exception'),  mockList)).add(fflib_Match.stringContains('Hello'));\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tmockList.add('Hi');\n\n\t\ttry\n\t\t{\n\t\t\tmockList.add('Hi Hello Hi');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (MyException e)\n\t\t{\n\t\t\t//Then\n\t\t\tSystem.Assert.areEqual('Matcher Exception', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenVerifyWithCombinedMatchersShouldReturnCorrectMethodCallCounts()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 0)).add(\n\t\t\t(String)fflib_Match.allOf(fflib_Match.eq('bob'), fflib_Match.stringContains('re'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(\n\t\t\t(String)fflib_Match.allOf(fflib_Match.eq('fred'), fflib_Match.stringContains('re'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add(\n\t\t\t(String)fflib_Match.anyOf(fflib_Match.eq('bob'), fflib_Match.eq('fred'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 1)).add(\n\t\t\t(String)fflib_Match.anyOf(fflib_Match.eq('bob'), fflib_Match.eq('jack'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add(\n\t\t\t(String)fflib_Match.noneOf(fflib_Match.eq('jack'), fflib_Match.eq('tim'))\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add(\n\t\t\t(String)fflib_Match.noneOf(\n\t\t\t\tfflib_Match.anyOf(fflib_Match.eq('jack'), fflib_Match.eq('jill')),\n\t\t\t\tfflib_Match.allOf(fflib_Match.eq('tim'), fflib_Match.stringContains('i'))\n\t\t\t)\n\t\t);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add(\n\t\t\t(String)fflib_Match.isNot(fflib_Match.eq('jack'))\n\t\t);\n\t}\n\n\t@isTest\n\tstatic void whenStubCustomMatchersCanBeUsed()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get((Integer)fflib_Match.matches(new isOdd()))).thenReturn('Odd');\n\t\tmocks.when(mockList.get((Integer)fflib_Match.matches(new isEven()))).thenReturn('Even');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString s1 = mockList.get(1);\n\t\tString s2 = mockList.get(2);\n\t\tString s3 = mockList.get(3);\n\t\tString s4 = mockList.get(4);\n\t\tString s5 = mockList.get(5);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('Odd', s1);\n\t\tSystem.Assert.areEqual('Even', s2);\n\t\tSystem.Assert.areEqual('Odd', s3);\n\t\tSystem.Assert.areEqual('Even', s4);\n\t\tSystem.Assert.areEqual('Odd', s5);\n\t}\n\n\t@isTest\n\tstatic void whenVerifyCustomMatchersCanBeUsed()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.get(1);\n\t\tmockList.get(2);\n\t\tmockList.get(3);\n\t\tmockList.get(4);\n\t\tmockList.get(5);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 3)).get((Integer)fflib_Match.matches(new isOdd()));\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).get((Integer)fflib_Match.matches(new isEven()));\n\t}\n\n\t@isTest\n\tstatic void whenStubWithMatcherAndNonMatcherArgumentsShouldThrowException()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tString expectedError = 'The number of matchers defined (1).'\n\t\t\t\t+ ' does not match the number expected (2)\\n'\n\t\t\t\t+ 'If you are using matchers all arguments must be passed in as matchers.\\n'\n\t\t\t\t+ 'For example myList.add(fflib_Match.anyInteger(), \\'String\\') should be defined as myList.add(fflib_Match.anyInteger(), fflib_Match.eq(\\'String\\')).';\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\tmocks.startStubbing();\n\t\t\tmocks.when(mockList.get2(fflib_Match.anyInteger(), 'String literal')).thenReturn('fail');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual(expectedError, e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenVerifyWithMatcherAndNonMatcherArgumentsShouldThrowException()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tString expectedError = 'The number of matchers defined (1).'\n\t\t\t\t+ ' does not match the number expected (2)\\n'\n\t\t\t\t+ 'If you are using matchers all arguments must be passed in as matchers.\\n'\n\t\t\t\t+ 'For example myList.add(fflib_Match.anyInteger(), \\'String\\') should be defined as myList.add(fflib_Match.anyInteger(), fflib_Match.eq(\\'String\\')).';\n\n\t\tmockList.get2(1, 'String literal');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) mocks.verify(mockList)).get2(fflib_Match.anyInteger(), 'String literal');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual(expectedError, e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenStubSameMethodWithMatchersAndNonMatchersShouldStubInOrder()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\n\t\tmocks.when(mockList.get2(1, 'Non-matcher first')).thenReturn('Bad'); //Set the return value using the non-matcher arguments\n\t\tmocks.when(mockList.get2(fflib_Match.eqInteger(1), fflib_Match.stringContains('Non-matcher first'))).thenReturn('Good'); //Override the return value using matcher arguments\n\n\t\tmocks.when(mockList.get2(fflib_Match.eqInteger(1), fflib_Match.stringContains('Matcher first'))).thenReturn('Bad'); //Set the return value using the matcher arguments\n\t\tmocks.when(mockList.get2(1, 'Matcher first')).thenReturn('Good'); //Override the return value using non-matcher arguments\n\n\t\tmocks.stopStubbing();\n\n\t\t// When/Thens\n\t\tSystem.Assert.areEqual('Good', mockList.get2(1, 'Non-matcher first'));\n\t\tSystem.Assert.areEqual('Good', mockList.get2(1, 'Matcher first'));\n\t}\n\n\t@isTest\n\tstatic void whenStubExceptionSameMethodWithMatchersAndNonMatchersShouldStubInOrder()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\n\t\t((fflib_MyList.IList)mocks.doThrowWhen(new fflib_ApexMocks.ApexMocksException('Bad'), mockList)).add('Non-matcher first'); //Set the exception value using the non-matcher arguments\n\t\t((fflib_MyList.IList)mocks.doThrowWhen(new fflib_ApexMocks.ApexMocksException('Good'), mockList)).add(fflib_Match.stringContains('Non-matcher first')); //Override the exception value using matcher arguments\n\n\t\t((fflib_MyList.IList)mocks.doThrowWhen(new fflib_ApexMocks.ApexMocksException('Bad'), mockList)).add(fflib_Match.stringContains('Matcher first')); //Set the exception value using the matcher arguments\n\t\t((fflib_MyList.IList)mocks.doThrowWhen(new fflib_ApexMocks.ApexMocksException('Good'), mockList)).add('Matcher first'); //Override the exception value using non-matcher arguments\n\n\t\tmocks.stopStubbing();\n\n\t\t// When/Thens\n\t\ttry\n\t\t{\n\t\t\tmockList.add('Non-matcher first');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Good', e.getMessage());\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tmockList.add('Matcher first');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Good', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenStubSingleCallWithSingleArgumentShouldReturnStubbedValue()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(0)).thenReturn('bob');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get(0);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('bob', actualValue);\n\t}\n\n\t@isTest\n\tstatic void whenStubSingleCallWithNullReturnValueItShouldReturnNull()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(0)).thenReturn(null);\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get(0);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual(null, actualValue);\n\t}\n\n\t@isTest\n\tstatic void whenStubMultipleCallsWithSingleArgumentShouldReturnStubbedValues()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(0)).thenReturn('bob');\n\t\tmocks.when(mockList.get(1)).thenReturn('fred');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValueArg0 = mockList.get(0);\n\t\tString actualValueArg1 = mockList.get(1);\n\t\tString actualValueArg2 = mockList.get(2);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('bob', actualValueArg0);\n\t\tSystem.Assert.areEqual('fred', actualValueArg1);\n\t\tSystem.Assert.areEqual(null, actualValueArg2);\n\t}\n\n\t@isTest\n\tstatic void whenStubSameCallWithDifferentArgumentValueShouldReturnLastStubbedValue()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(0)).thenReturn('bob1');\n\t\tmocks.when(mockList.get(0)).thenReturn('bob2');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValue = mockList.get(0);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('bob2', actualValue);\n\t}\n\n\t@isTest\n\tstatic void whenStubCallWithNoArgumentsShouldReturnStubbedValue()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.isEmpty()).thenReturn(false);\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tBoolean actualValue = mockList.isEmpty();\n\n\t\t// Then\n\t\tSystem.Assert.areEqual(false, actualValue);\n\t}\n\n\t@isTest\n\tstatic void verifySingleMethodCallWithNoArguments()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.isEmpty();\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).isEmpty();\n\t}\n\n\t@isTest\n\tstatic void verifySingleMethodCallWithSingleArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('bob');\n\t}\n\n\t@isTest\n\tstatic void verifyMultipleMethodCallsWithSameSingleArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add('bob');\n\t}\n\n\t@isTest\n\tstatic void verifyMultipleMethodCallsWithDifferentSingleArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add('fred');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('bob');\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('fred');\n\t}\n\n\t@isTest\n\tstatic void verifyMethodCallsWithSameNameButDifferentArgumentTypes()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\t\tmockList.add(new String[] {'bob'});\n\t\tmockList.add((String)null);\n\t\tmockList.add((String[])null);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('bob');\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(new String[] {'bob'});\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add((String)null);\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add((String[])null);\n\t}\n\n\t@isTest\n\tstatic void verifyMethodNotCalled()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.get(0);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).add('bob');\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).get(0);\n\t}\n\n\t@isTest\n\tstatic void stubAndVerifyMethodCallsWithNoArguments()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.isEmpty()).thenReturn(false);\n\t\tmocks.stopStubbing();\n\n\t\tmockList.clear();\n\n\t\t// When\n\t\tBoolean actualValue = mockList.isEmpty();\n\n\t\t// Then\n\t\tSystem.Assert.areEqual(false, actualValue);\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).clear();\n\t}\n\n\t@isTest\n\tstatic void whenStubExceptionTheExceptionShouldBeThrown()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(0)).thenThrow(new MyException('Stubbed exception.'));\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.get(0);\n\t\t\tSystem.Assert.fail('Stubbed exception should have been thrown.');\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t// Then\n\t\t\tSystem.Assert.isInstanceOfType(e, MyException.class);\n\t\t\tSystem.Assert.areEqual('Stubbed exception.', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenStubVoidMethodWithExceptionThenExceptionShouldBeThrown()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList.IList) mocks.doThrowWhen(new MyException('Stubbed exception.'), mockList)).clear();\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.clear();\n\t\t\tSystem.Assert.fail('Stubbed exception should have been thrown.');\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t// Then\n\t\t\tSystem.Assert.isInstanceOfType(e, MyException.class);\n\t\t\tSystem.Assert.areEqual('Stubbed exception.', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenStubMultipleVoidMethodsWithExceptionsThenExceptionsShouldBeThrown()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList.IList) mocks.doThrowWhen(new MyException('clear stubbed exception.'), mockList)).clear();\n\t\t((fflib_MyList.IList) mocks.doThrowWhen(new MyException('add stubbed exception.'), mockList)).add('bob');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.clear();\n\t\t\tSystem.Assert.fail('Stubbed exception should have been thrown.');\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t// Then\n\t\t\tSystem.Assert.isInstanceOfType(e, MyException.class);\n\t\t\tSystem.Assert.areEqual('clear stubbed exception.', e.getMessage());\n\t\t}\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.add('bob');\n\t\t\tSystem.Assert.fail('Stubbed exception should have been thrown.');\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t// Then\n\t\t\tSystem.Assert.isInstanceOfType(e, MyException.class);\n\t\t\tSystem.Assert.areEqual('add stubbed exception.', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void whenStubVoidMethodWithExceptionAndCallMethodTwiceThenExceptionShouldBeThrownTwice()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\t((fflib_MyList.IList) mocks.doThrowWhen(new MyException('clear stubbed exception.'), mockList)).clear();\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.clear();\n\t\t\tSystem.Assert.fail('Stubbed exception should have been thrown.');\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t// Then\n\t\t\tSystem.Assert.isInstanceOfType(e, MyException.class);\n\t\t\tSystem.Assert.areEqual('clear stubbed exception.', e.getMessage());\n\t\t}\n\n\t\t// When\n\t\ttry\n\t\t{\n\t\t\tmockList.clear();\n\t\t\tSystem.Assert.fail('Stubbed exception should have been thrown.');\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t// Then\n\t\t\tSystem.Assert.isInstanceOfType(e, MyException.class);\n\t\t\tSystem.Assert.areEqual('clear stubbed exception.', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void verifyMethodCallWhenNoCallsBeenMadeForType()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).add('bob');\n\t}\n\n\t@isTest\n\tstatic void verifySingleMethodCallWithMultipleArguments()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.set(0, 'bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).set(0, 'bob');\n\t\t((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).set(0, 'fred');\n\t}\n\n\t@isTest\n\tstatic void whenStubMultipleCallsWithMultipleArgumentShouldReturnStubbedValues()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get2(0, 'zero')).thenReturn('bob');\n\t\tmocks.when(mockList.get2(1, 'one')).thenReturn('fred');\n\t\tmocks.when(mockList.get2(0, 'two')).thenReturn('bob');\n\t\tmocks.when(mockList.get2(1, 'three')).thenReturn('bub');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actualValueArg0 = mockList.get2(0, 'zero');\n\t\tString actualValueArg1 = mockList.get2(1, 'one');\n\t\tString actualValueArg2 = mockList.get2(0, 'two');\n\t\tString actualValueArg3 = mockList.get2(1, 'three');\n\t\tString actualValueArg4 = mockList.get2(0, 'three');\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('bob', actualValueArg0);\n\t\tSystem.Assert.areEqual('fred', actualValueArg1);\n\t\tSystem.Assert.areEqual('bob', actualValueArg2);\n\t\tSystem.Assert.areEqual('bub', actualValueArg3);\n\t\tSystem.Assert.areEqual(null, actualValueArg4);\n\t}\n\n\t@isTest\n\tstatic void whenStubNullConcreteArgValueCorrectValueIsReturned()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tString expected = 'hello';\n\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(null)).thenReturn(expected);\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actual = mockList.get(null);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual(expected, actual);\n\t}\n\n\t@isTest\n\tstatic void whenSetDoThrowWhenExceptionsValuesAreSet()\n\t{\n\t\t//Given\n\t\tMyException e = new MyException('Test');\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\n\t\tList<Exception> expsList = new List<Exception>{e};\n\n\t\t//When\n\t\tmocks.DoThrowWhenExceptions = expsList;\n\n\t\t//Then\n\t\tSystem.Assert.areEqual(expsList, mocks.DoThrowWhenExceptions);\n\t}\n\n\t@isTest\n\tstatic void whenVerifyMethodNeverCalledMatchersAreReset()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).get(fflib_Match.anyInteger());\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(fflib_Match.anyString());\n\t}\n\n\t@isTest\n\tstatic void whenMockIsGeneratedCanVerify()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('bob');\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER)).get(fflib_Match.anyInteger());\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add('bob');\n\t}\n\n\t@isTest\n\tstatic void whenMockIsGeneratedCanStubVerify()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmocks.startStubbing();\n\t\tmocks.when(mockList.get(1)).thenReturn('One');\n\t\tmocks.when(mockList.get(fflib_Match.integerMoreThan(2))).thenReturn('>Two');\n\t\tmocks.stopStubbing();\n\n\t\t// Then\n\t\tSystem.Assert.areEqual(null, mockList.get(0));\n\t\tSystem.Assert.areEqual('One', mockList.get(1));\n\t\tSystem.Assert.areEqual(null, mockList.get(2));\n\t\tSystem.Assert.areEqual('>Two', mockList.get(3));\n\t}\n\n\t@isTest\n\tstatic void whenMockVoidMethodRecordsCallCanVerify()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmocks.mockVoidMethod(\n\t\t\tmockList,\n\t\t\t'clear',\n\t\t\tnew List<Type>(),\n\t\t\tnew List<Object>()\n\t\t);\n\n\t\t// Then\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 1)).clear();\n\t}\n\n\t@isTest\n\tstatic void thatMultipleInstancesCanBeMockedIndependently()\n\t{\n\t\tfflib_ApexMocksConfig.HasIndependentMocks = true;\n\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList first = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_MyList second = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\t\n\t\tmocks.startStubbing();\n\t\tmocks.when(first.get(0)).thenReturn('First');\n\t\tmocks.when(second.get(0)).thenReturn('Second');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actual = first.get(0);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('First', actual, 'Should have returned stubbed value');\n\t\t((fflib_MyList)mocks.verify(first)).get(0);\n\t\t((fflib_MyList)mocks.verify(second, mocks.never())).get(0);\n\t}\n\n\t@isTest\n\tstatic void thatMultipleInstancesCanBeMockedDependently()\n\t{\n\t\tfflib_ApexMocksConfig.HasIndependentMocks = false;\n\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList first = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_MyList second = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\t\n\t\tmocks.startStubbing();\n\t\tmocks.when(first.get(0)).thenReturn('First');\n\t\tmocks.when(second.get(0)).thenReturn('Second');\n\t\tmocks.stopStubbing();\n\n\t\t// When\n\t\tString actual = first.get(0);\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('Second', actual, 'Should have returned stubbed value');\n\t\t((fflib_MyList)mocks.verify(first)).get(0);\n\t\t((fflib_MyList)mocks.verify(second)).get(0);\n\t}\n\n\tstatic void thatStubbingCanBeChainedFirstExceptionThenValue()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(new MyException('Stubbed exception.')).thenReturn('One');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('Stubbed exception.');\n\t\tassertReturnedValue('One');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingCanBeChainedFirstValueThenException()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('One').thenThrow(new MyException('Stubbed exception.'));\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertExceptionMessage('Stubbed exception.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleMethodsCanBeChainedFirstExceptionThenValue()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(new MyException('Stubbed exception.')).thenReturn('One');\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get2(2, 'Hello.')).thenThrow(new MyException('Stubbed exception2.')).thenReturn('One2');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('Stubbed exception.');\n\t\tassertReturnedValue('One');\n\t\tassertExceptionMessageForGet2('Stubbed exception2.');\n\t\tassertReturnedValueForGet2('One2');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleMethodsCanBeChainedFirstValueThenException()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('One').thenThrow(new MyException('Stubbed exception.'));\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get2(2, 'Hello.')).thenReturn('One2').thenThrow(new MyException('Stubbed exception2.'));\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertExceptionMessage('Stubbed exception.');\n\t\tassertReturnedValueForGet2('One2');\n\t\tassertExceptionMessageForGet2('Stubbed exception2.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingReturnsDifferentValuesForDifferentCalls()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Three');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingReturnsDifferentValuesForDifferentCallsAndRepeatLastValuesForFurtherCalls()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Three');\n\n\t\tassertReturnedValue('Three');\n\t\tassertReturnedValue('Three');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingThrowsDifferentExceptionsForDifferentCalls()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingThrowsDifferentExceptionsForDifferentCallsAndRepeatLastExceptionForFurtherCalls()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\n\t\tassertExceptionMessage('third.');\n\t\tassertExceptionMessage('third.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingThrowsAndReturnsDifferentExceptionsAndValuesForDifferentCalls()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).\n\t\t\tthenThrowMulti(new List<Exception>{first, second, third}).\n\t\t\tthenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\n\t\tassertReturnedValue('One');\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Three');\n\n\t\tassertReturnedValue('Three');\n\t\tassertReturnedValue('Three');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingReturnsAndThrowsDifferentValuesAndExceptionsForDifferentCalls()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).\n\t\t\tthenReturnMulti(new List<String>{'One', 'Two', 'Three'}).\n\t\t\tthenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Three');\n\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\n\t\tassertExceptionMessage('third.');\n\t\tassertExceptionMessage('third.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnWithSingleValue()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('One');\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Two');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnMultiWithSingleValue()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Two');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnMultiWithMultiValue()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'Four', 'Five', 'Six'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('Four');\n\t\tassertReturnedValue('Five');\n\t\tassertReturnedValue('Six');\n\n\t\tassertReturnedValue('Six');\n\t\tassertReturnedValue('Six');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnWithMultiValues()\n\t{\n\t\t// Given\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Three');\n\n\t\tassertReturnedValue('Three');\n\t\tassertReturnedValue('Three');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnMultiWithSingleException()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(first);\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('first.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnMultiWithMultiExceptions()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\n\t\tassertExceptionMessage('third.');\n\t\tassertExceptionMessage('third.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnWithMultiExceptions()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\n\t\tassertExceptionMessage('third.');\n\t\tassertExceptionMessage('third.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenReturnWithSingleException()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(first);\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('first.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowWithSingleValue()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(first);\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Two');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowMultiWithSingleValue()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn('Two');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Two');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowMultiWithMultiValue()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'Four', 'Five', 'Six'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('Four');\n\t\tassertReturnedValue('Five');\n\t\tassertReturnedValue('Six');\n\n\t\tassertReturnedValue('Six');\n\t\tassertReturnedValue('Six');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowWithMultiValues()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(first);\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<String>{'One', 'Two', 'Three'});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertReturnedValue('One');\n\t\tassertReturnedValue('Two');\n\t\tassertReturnedValue('Three');\n\n\t\tassertReturnedValue('Three');\n\t\tassertReturnedValue('Three');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowMultiWithSingleException()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\t\tMyException fourth = new MyException('fourth.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(fourth);\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('fourth.');\n\t\tassertExceptionMessage('fourth.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowMultiWithMultiExceptions()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\tMyException fourth = new MyException('fourth.');\n\t\tMyException fifth = new MyException('fifth.');\n\t\tMyException sixth = new MyException('sixth.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{fourth, fifth, sixth});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('fourth.');\n\t\tassertExceptionMessage('fifth.');\n\t\tassertExceptionMessage('sixth.');\n\n\t\tassertExceptionMessage('sixth.');\n\t\tassertExceptionMessage('sixth.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowWithMultiExceptions()\n\t{\n\t\t// Given\n\t\tMyException beforeFirst = new MyException('before first.');\n\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(beforeFirst);\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>{first, second, third});\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('second.');\n\t\tassertExceptionMessage('third.');\n\n\t\tassertExceptionMessage('third.');\n\t\tassertExceptionMessage('third.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMultipleTimesOverridePreviousThenThrowWithSingleException()\n\t{\n\t\t// Given\n\t\tMyException beforeFirst = new MyException('before first.');\n\t\tMyException first = new MyException('first.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(beforeFirst);\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(first);\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessage('first.');\n\t\tassertExceptionMessage('first.');\n\t}\n\n\t@isTest\n\tstatic void thatVoidMethodThrowsMultipleExceptions()\n\t{\n\t\t// Given\n\t\tMyException beforeFirst = new MyException('before first.');\n\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(new List<Exception>{first, second, third},  MY_MOCK_LIST)).add('Hello');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessageOnVoidMethod('first.');\n\t\tassertExceptionMessageOnVoidMethod('second.');\n\t\tassertExceptionMessageOnVoidMethod('third.');\n\n\t\tassertExceptionMessageOnVoidMethod('third.');\n\t\tassertExceptionMessageOnVoidMethod('third.');\n\t}\n\n\t@isTest\n\tstatic void thatMultipleVoidMethodsThrowsMultipleExceptions()\n\t{\n\t\t// Given\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\tMyException first2 = new MyException('first2.');\n\t\tMyException second2 = new MyException('second2.');\n\t\tMyException third2 = new MyException('third2.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(new List<Exception>{first2, second2, third2},  MY_MOCK_LIST)).addMore('Hello');\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(new List<Exception>{first, second, third},  MY_MOCK_LIST)).add('Hello');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessageOnVoidMethod('first.');\n\t\tassertExceptionMessageOnVoidMethod('second.');\n\t\tassertExceptionMessageOnVoidMethod('third.');\n\n\t\tassertExceptionMessageOnVoidMethod('third.');\n\t\tassertExceptionMessageOnVoidMethod('third.');\n\n\n\t\tassertExceptionMessageOnAddMoreVoidMethod('first2.');\n\t\tassertExceptionMessageOnAddMoreVoidMethod('second2.');\n\t\tassertExceptionMessageOnAddMoreVoidMethod('third2.');\n\n\t\tassertExceptionMessageOnAddMoreVoidMethod('third2.');\n\t\tassertExceptionMessageOnAddMoreVoidMethod('third2.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMutipleTimesVoidMethodThrowsMultipleExceptionsOverride()\n\t{\n\t\t// Given\n\t\tMyException beforeFirst = new MyException('before first.');\n\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\tMyException fourth = new MyException('fourth.');\n\t\tMyException fifth = new MyException('fifth.');\n\t\tMyException sixth = new MyException('sixth.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(new List<Exception>{first, second, third},  MY_MOCK_LIST)).add('Hello');\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(new List<Exception>{fourth, fifth, sixth},  MY_MOCK_LIST)).add('Hello');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessageOnVoidMethod('fourth.');\n\t\tassertExceptionMessageOnVoidMethod('fifth.');\n\t\tassertExceptionMessageOnVoidMethod('sixth.');\n\n\t\tassertExceptionMessageOnVoidMethod('sixth.');\n\t\tassertExceptionMessageOnVoidMethod('sixth.');\n\t}\n\n\t@isTest\n\tstatic void thatStubbingMutipleTimesVoidMethodThrowsMultipleExceptionsOverrideWithSingleException()\n\t{\n\t\t// Given\n\t\tMyException beforeFirst = new MyException('before first.');\n\n\t\tMyException first = new MyException('first.');\n\t\tMyException second = new MyException('second.');\n\t\tMyException third = new MyException('third.');\n\n\t\tMyException fourth = new MyException('fourth.');\n\t\tMyException fifth = new MyException('fifth.');\n\t\tMyException sixth = new MyException('sixth.');\n\n\t\t// When\n\t\tMY_MOCKS.startStubbing();\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(new List<Exception>{first, second, third},  MY_MOCK_LIST)).add('Hello');\n\t\t((fflib_MyList.IList) MY_MOCKS.doThrowWhen(fourth,  MY_MOCK_LIST)).add('Hello');\n\t\tMY_MOCKS.stopStubbing();\n\n\t\t// Then\n\t\tassertExceptionMessageOnVoidMethod('fourth.');\n\t\tassertExceptionMessageOnVoidMethod('fourth.');\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsthrownWhenStubbingIsNotDone()\n\t{\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1));\n\t\tMY_MOCKS.stopStubbing();\n\n\t\ttry\n\t\t{\n\t\t\tMY_MOCK_LIST.get(1);\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(\n\t\t\t\t'The stubbing is not correct, no return values have been set.',\n\t\t\t\tmyex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsthrownWhenReturnMultiPassEmptyList()\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCKS.startStubbing();\n\t\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(new List<Object>());\n\t\t\tMY_MOCKS.stopStubbing();\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(\n\t\t\t\t'The stubbing is not correct, no return values have been set.',\n\t\t\t\tmyex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsthrownWhenReturnMultiPassNullList()\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCKS.startStubbing();\n\t\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturnMulti(null);\n\t\t\tMY_MOCKS.stopStubbing();\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(\n\t\t\t\t'The stubbing is not correct, no return values have been set.',\n\t\t\t\tmyex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsthrownWhenThrowMultiPassEmptyList()\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCKS.startStubbing();\n\t\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(new List<Exception>());\n\t\t\tMY_MOCKS.stopStubbing();\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(\n\t\t\t\t'The stubbing is not correct, no return values have been set.',\n\t\t\t\tmyex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatExceptionIsthrownWhenThrowMultiPassNullList()\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCKS.startStubbing();\n\t\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrowMulti(null);\n\t\t\tMY_MOCKS.stopStubbing();\n\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(\n\t\t\t\t'The stubbing is not correct, no return values have been set.',\n\t\t\t\tmyex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatNullCanBeUsedAsReturnValue()\n\t{\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenReturn(null);\n\t\tMY_MOCKS.stopStubbing();\n\n\n\t\tSystem.Assert.areEqual(null, MY_MOCK_LIST.get(1), 'it should be possible stub using the null value');\n\t}\n\n\t@isTest\n\tstatic void thatNullCanBeUsedAsExceptionvalue()\n\t{\n\t\tMY_MOCKS.startStubbing();\n\t\tMY_MOCKS.when(MY_MOCK_LIST.get(1)).thenThrow(null);\n\t\tMY_MOCKS.stopStubbing();\n\n\t\tSystem.Assert.areEqual(null, MY_MOCK_LIST.get(1), 'it should be possible stub using the null value');\n\t}\n\n\n\n\tprivate static void assertExceptionMessage(String expectedMessage)\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCK_LIST.get(1);\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(MyException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(expectedMessage, myex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\tprivate static void assertExceptionMessageForGet2(String expectedMessage)\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCK_LIST.get2(2, 'Hello.');\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(MyException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(expectedMessage, myex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\tprivate static void assertExceptionMessageOnVoidMethod(String expectedMessage)\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCK_LIST.add('Hello');\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(MyException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(expectedMessage, myex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\tprivate static void assertExceptionMessageOnAddMoreVoidMethod(String expectedMessage)\n\t{\n\t\ttry\n\t\t{\n\t\t\tMY_MOCK_LIST.addMore('Hello');\n\t\t\tSystem.Assert.fail('an exception was expected');\n\t\t}\n\t\tcatch(MyException myex)\n\t\t{\n\t\t\tSystem.Assert.areEqual(expectedMessage, myex.getMessage(), 'the message reported by the exception is not correct');\n\t\t}\n\t}\n\n\tprivate static void assertReturnedValue(String expectedValue)\n\t{\n\t\tSystem.Assert.areEqual(expectedValue, MY_MOCK_LIST.get(1), 'the method did not returned the expected value');\n\t}\n\n\tprivate static void assertReturnedValueForGet2(String expectedValue)\n\t{\n\t\tSystem.Assert.areEqual(expectedValue, MY_MOCK_LIST.get2(2, 'Hello.'), 'the method did not returned the expected value');\n\t}\n\t\n\t@isTest\n\tstatic void thatToStringReturnsSimpleStringValue()\n\t{\n\t\tSystem.Assert.areEqual('fflib_ApexMocks', '' + new fflib_ApexMocks());\n\t}\n\n\tprivate class MyException extends Exception\n\t{\n\t}\n\n\tprivate class isOdd implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg instanceof Integer ? Math.mod((Integer)arg, 2) == 1: false;\n\t\t}\n\t}\n\n\tprivate class isEven implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn arg instanceof Integer ? Math.mod((Integer)arg, 2) == 0: false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_ApexMocksTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_ApexMocksUtilsTest.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@isTest\npublic class fflib_ApexMocksUtilsTest\n{\n\tpublic static Schema.FieldSet findAnyFieldSet()\n\t{\n\t\tfor (Schema.SObjectType objectType : Schema.getGlobalDescribe().values())\n\t\t{\n\t\t\tfor (Schema.FieldSet fs : objectType.getDescribe().FieldSets.getMap().values())\n\t\t\t{\n\t\t\t\treturn fs;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t@isTest\n\tprivate static void makeRelationship_returnsObjectsWithRelationFieldSet()\n\t{\n\t\t//Given\n\t\tAccount acc = new Account(\n\t\t\tId = fflib_IDGenerator.generate(Account.SObjectType),\n\t\t\tName = 'AccName',\n\t\t\tNumberOfEmployees = 7\n\t\t);\n\n\t\tContact contact1 = new Contact(\n\t\t\tId = fflib_IDGenerator.generate(Contact.SObjectType),\n\t\t\tDoNotCall = true\n\t\t);\n\n\t\tContact contact2 = new Contact(\n\t\t\tId = fflib_IDGenerator.generate(Contact.SObjectType),\n\t\t\tDoNotCall = false\n\t\t);\n\n\t\t//When\n\t\tAccount accWithRelationships = ((List<Account>)fflib_ApexMocksUtils.makeRelationship(\n\t\t\tList<Account>.class,\n\t\t\tnew List<Account> { acc },\n\t\t\tContact.AccountId,\n\t\t\tnew List<List<Contact>> { new List<Contact> { contact1, contact2 }}\n\t\t))[0];\n\n\t\t//Then\n\t\tSystem.Assert.areEqual(acc.Id, accWithRelationships.Id);\n\t\tSystem.Assert.areEqual(acc.Name, accWithRelationships.Name);\n\t\tSystem.Assert.areEqual(acc.NumberOfEmployees, accWithRelationships.NumberOfEmployees);\n\t\t\n\t\t//Assert relationship fields\n\t\tList<Contact> contacts = accWithRelationships.Contacts;\n\t\tSystem.Assert.areNotEqual(null, contacts);\n\t\tSystem.Assert.areEqual(2, contacts.size());\n\n\t\tSystem.Assert.areEqual(contact1.Id, contacts[0].Id);\n\t\tSystem.Assert.areEqual(contact1.DoNotCall, contacts[0].DoNotCall);\n\n\t\tSystem.Assert.areEqual(contact2.Id, contacts[1].Id);\n\t\tSystem.Assert.areEqual(contact2.DoNotCall, contacts[1].DoNotCall);\n\t}\n\n\t@isTest\n\tprivate static void makeRelationship_GenericOverload_ReturnsObjectsWithRelationFieldSet() \n\t{\n\t\t//Given\n\t\tSObject acc = Schema.getGlobalDescribe().get('Account').newSObject();\n\t\tacc.put('Id', fflib_IDGenerator.generate(acc.getSObjectType()));\n\t\tacc.put('Name', 'AccName');\n\t\tacc.put('NumberOfEmployees', 7);\n\n\t\tSObject contact1 = Schema.getGlobalDescribe().get('Contact').newSObject();\n\t\tcontact1.put('Id', fflib_IDGenerator.generate(contact1.getSObjectType()));\n\t\tcontact1.put('DoNotCall', true);\n\n\t\tSObject contact2 = Schema.getGlobalDescribe().get('Contact').newSObject();\n\t\tcontact2.put('Id', fflib_IDGenerator.generate(contact2.getSObjectType()));\n\t\tcontact2.put('DoNotCall', false);\n\n\t\t//When\n\t\tSObject accWithRelationships = ((List<SObject>)fflib_ApexMocksUtils.makeRelationship(\n\t\t\t\t'Account',\n\t\t\t\t'Contact',\n\t\t\t\tnew List<SObject> { acc },\n\t\t\t\t'AccountId',\n\t\t\t\tnew List<List<SObject>> { new List<SObject> { contact1, contact2 }}\n\n\t\t))[0];\n\n\t\t//Then\n\t\tSystem.Assert.areEqual(acc.Id, accWithRelationships.Id);\n\t\tSystem.Assert.areEqual(acc.get('Name'), accWithRelationships.get('Name'));\n\t\tSystem.Assert.areEqual(acc.get('NumberOfEmployees'), accWithRelationships.get('NumberOfEmployees'));\n\n\t\t//Assert relationship fields\n\t\tList<SObject> contacts = accWithRelationships.getSObjects('Contacts');\n\t\tSystem.Assert.areNotEqual(null, contacts);\n\t\tSystem.Assert.areEqual(2, contacts.size());\n\n\t\tSystem.Assert.areEqual(contact1.Id, contacts[0].Id);\n\t\tSystem.Assert.areEqual((Boolean)contact1.get('DoNotCall'), (Boolean)contacts[0].get('DoNotCall'));\n\n\t\tSystem.Assert.areEqual(contact2.Id, contacts[1].Id);\n\t\tSystem.Assert.areEqual((Boolean)contact2.get('DoNotCall'), (Boolean)contacts[1].get('DoNotCall'));\n\t}\n\n\t@isTest\n\tprivate static void makeRelationship_GenericOverload_ThrowsErrorOnInvalidParentType() \n\t{\n\t\t// Setup parent object\n\t\tSObject acc = Schema.getGlobalDescribe().get('Account').newSObject();\n\t\tacc.put('Id', fflib_IDGenerator.generate(acc.getSObjectType()));\n\n\t\t// Setup child object\n\t\tSObject cont = Schema.getGlobalDescribe().get('Contact').newSObject();\n\t\tcont.put('Id', fflib_IDGenerator.generate(cont.getSObjectType()));\n\n\t\tString errorMessage = '';\n\t\ttry {\n\t\t\t// Call method under test\n\t\t\tSObject accWithRelationships = ((List<SObject>)fflib_ApexMocksUtils.makeRelationship(\n\t\t\t\t\t'MyInvalidParentType',\n\t\t\t\t\t'Contact',\n\t\t\t\t\tnew List<SObject> { acc },\n\t\t\t\t\t'AccountId',\n\t\t\t\t\tnew List<List<SObject>> { new List<SObject> { cont }}\n\t\t\t))[0];\n\t\t} catch (Exception exc) {\n\t\t\terrorMessage = exc.getMessage();\n\t\t}\n\t\tSystem.Assert.areEqual('SObject type not found: MyInvalidParentType', errorMessage);\n\t}\n\n\t@isTest\n\tprivate static void makeRelationship_GenericOverload_ThrowsErrorOnInvalidChildType() \n\t{\n\t\t// Setup parent object\n\t\tSObject acc = Schema.getGlobalDescribe().get('Account').newSObject();\n\t\tacc.put('Id', fflib_IDGenerator.generate(acc.getSObjectType()));\n\n\t\t// Setup child object\n\t\tSObject cont = Schema.getGlobalDescribe().get('Contact').newSObject();\n\t\tcont.put('Id', fflib_IDGenerator.generate(cont.getSObjectType()));\n\n\t\tString errorMessage = '';\n\t\ttry {\n\t\t\t// Call method under test\n\t\t\tSObject accWithRelationships = ((List<SObject>)fflib_ApexMocksUtils.makeRelationship(\n\t\t\t\t\t'Account',\n\t\t\t\t\t'MyInvalidChildType',\n\t\t\t\t\tnew List<SObject> { acc },\n\t\t\t\t\t'AccountId',\n\t\t\t\t\tnew List<List<SObject>> { new List<SObject> { cont }}\n\t\t\t))[0];\n\t\t} catch (Exception exc) {\n\t\t\terrorMessage = exc.getMessage();\n\t\t}\n\t\tSystem.Assert.areEqual('SObject type not found: MyInvalidChildType', errorMessage);\n\t}\n\n\t@isTest\n\tprivate static void makeRelationship_GenericOverload_ThrowsErrorOnInvalidFieldName() \n\t{\n\t\t// Setup parent object\n\t\tSObject acc = Schema.getGlobalDescribe().get('Account').newSObject();\n\t\tacc.put('Id', fflib_IDGenerator.generate(acc.getSObjectType()));\n\n\t\t// Setup child object\n\t\tSObject cont = Schema.getGlobalDescribe().get('Contact').newSObject();\n\t\tcont.put('Id', fflib_IDGenerator.generate(cont.getSObjectType()));\n\n\t\tString errorMessage = '';\n\t\ttry {\n\t\t\t// Call method under test\n\t\t\tSObject accWithRelationships = ((List<SObject>)fflib_ApexMocksUtils.makeRelationship(\n\t\t\t\t\t'Account',\n\t\t\t\t\t'Contact',\n\t\t\t\t\tnew List<SObject> { acc },\n\t\t\t\t\t'MyInvalidField',\n\t\t\t\t\tnew List<List<SObject>> { new List<SObject> { cont }}\n\t\t\t))[0];\n\t\t} catch (Exception exc) {\n\t\t\terrorMessage = exc.getMessage();\n\t\t}\n\t\tSystem.Assert.areEqual('SObject field not found: MyInvalidField', errorMessage);\n\t}\n\n\t@IsTest \n\tprivate static void makeRelationship_ObjectWithNull_DoesNotThrowErrorOnJSONExceptionCanNotWriteAFieldNameExpectingAValue() \n\t{\t\n\t\t// Given\n\t\tProduct2 prod1 = new Product2(\n\t\t\tId = fflib_IDGenerator.generate(Product2.SObjectType),\n\t\t\tName = 'Product1',\n\t\t\tProductCode = 'P1',\n\t\t\tDescription = null,\n\t\t\tStockKeepingUnit = 'P1'\n\t\t);\n\n\t\tProduct2 prod2 = new Product2(\n\t\t\tId = fflib_IDGenerator.generate(Product2.SObjectType),\n\t\t\tName = 'Product2',\n\t\t\tProductCode = 'P2',\n\t\t\tDescription = 'this is another product',\n\t\t\tStockKeepingUnit = 'P2'\n\t\t);\n\n\t\tOpportunityLineItem oli1 = new OpportunityLineItem(\n\t\t\tId = fflib_IDGenerator.generate(OpportunityLineItem.SObjectType),\n\t\t\tProduct2Id = prod1.Id,\n\t\t\tProduct2 = prod1,\n\t\t\tUnitPrice = 10,\n\t\t\tQuantity = 1\n\t\t);\n\n\t\tOpportunityLineItem oli2 = new OpportunityLineItem(\n\t\t\tId = fflib_IDGenerator.generate(OpportunityLineItem.SObjectType),\n\t\t\tProduct2Id = prod2.Id,\n\t\t\tProduct2 = prod2,\n\t\t\tUnitPrice = 10,\n\t\t\tQuantity = 1\n\t\t);\n\n\t\tOpportunity opportunity = new Opportunity();\n\n\t\tException exceptionThatWasCalled = null;\n\n\t\t// When\n\t\tTest.startTest();\n\t\t\n\t\ttry {\n\t\t\tfflib_ApexMocksUtils.makeRelationship(\n\t\t\t\tList<Opportunity>.class,\n\t\t\t\tnew List<Opportunity>{ opportunity },\n\t\t\t\tOpportunityLineItem.OpportunityId,\n\t\t\t\tnew List<List<OpportunityLineItem>>{ new List<OpportunityLineItem>{oli1, oli2} }\n\t\t\t);\n\t\t} catch (JSONException e) {\n\t\t\texceptionThatWasCalled = e;\n\t\t}\n\n\t\tTest.stopTest();\n\n\t\t// Then\n\t\tSystem.debug(exceptionThatWasCalled);\n\t\tAssert.isNull(exceptionThatWasCalled, 'Exception should not have been called');\n\t}\n\n\t@isTest\n\tstatic void setReadOnlyFields_CreatedByIdSetToCurrentUserId_IdFieldSetSuccessfully() {\n\t\t\n\t\tAccount acc = new Account();\n\t\tId userId = fflib_IDGenerator.generate((new User()).getSObjectType());\n\n\t\tTest.startTest();\n\t\tacc = (Account)fflib_ApexMocksUtils.setReadOnlyFields(\n\t\t\t\tacc,\n\t\t\t\tAccount.class,\n\t\t\t\tnew Map<SObjectField, Object>{Account.CreatedById => userId}\n\t\t);\n\t\tTest.stopTest();\n\n\t\tSystem.Assert.areEqual(userId, acc.CreatedById);\n\t}\n\n\t@isTest\n\tstatic void setReadOnlyFields_LastReferencedDateSetOnAccount_DateTimeFieldSetSuccessfully() {\n\t\t\n\t\tAccount acc = new Account();\n\t\tDateTime lastRefDate = DateTime.newInstanceGmt(2020, 1, 7, 23, 30, 0);\n\n\t\tTest.startTest();\n\t\tacc = (Account)fflib_ApexMocksUtils.setReadOnlyFields(\n\t\t\t\tacc,\n\t\t\t\tAccount.class,\n\t\t\t\tnew Map<SObjectField, Object> {Account.LastReferencedDate => lastRefDate}\n\t\t);\n\t\tTest.stopTest();\n\n\t\tSystem.Assert.areEqual(lastRefDate, acc.LastReferencedDate);\n\t}\n\n\t@isTest\n\tstatic void setReadOnlyFields_IsDeletedSetOnAccount_BooleanFieldSetSuccessfully() {\n\n\t\tAccount acc = new Account();\n\t\tBoolean isDeleted = true;\n\n\t\tTest.startTest();\n\t\tacc = (Account)fflib_ApexMocksUtils.setReadOnlyFields(\n\t\t\t\tacc,\n\t\t\t\tAccount.class,\n\t\t\t\tnew Map<SObjectField, Object> {Account.IsDeleted => isDeleted}\n\t\t);\n\t\tTest.stopTest();\n\n\t\tSystem.Assert.areEqual(isDeleted, acc.IsDeleted);\n\t}\n\n\t@isTest\n\tstatic void setReadOnlyFields_PolymorphicRelationJoin_FieldSetSuccessfully() {\n\n\t\tAccount acc = new Account(Name='TestAccount');\n\t\tTask t = new Task();\n\n\t\tTest.startTest();\n\t\tt = (Task)fflib_ApexMocksUtils.setReadOnlyFields(\n\t\t\tt,\n\t\t\tTask.class,\n\t\t\tnew Map<String, Object> {'What' => acc}\n\t\t);\n\t\tTest.stopTest();\n\n\t\tSystem.Assert.areEqual(acc.Name, t.What.Name);\n\t}\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_ApexMocksUtilsTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_ArgumentCaptorTest.cls",
    "content": "/*\n * Copyright (c) 2016-2017 FinancialForce.com, inc.  All rights reserved.\n */\n/**\n * @nodoc\n */\n@isTest\nprivate class fflib_ArgumentCaptorTest\n{\n\t@isTest\n\tstatic void thatArgumentValueIsCaptured()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add((String) argument.capture());\n\n\t\tSystem.Assert.areEqual('Fred', (String)argument.getValue(), 'the argument captured is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCanPerformFurtherAssertionsOnCapturedArgumentValue()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t//When\n\t\tTestInnerClass testValue = new TestInnerClass();\n\t\ttestValue.i = 4;\n\t\ttestValue.s = '5';\n\n\t\tmockList.set(1, testValue);\n\n\t\t//Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(TestInnerClass.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).set(fflib_Match.anyInteger(),  argument.capture());\n\n\t\tObject capturedArg = argument.getValue();\n\t\tSystem.Assert.areNotEqual(null, capturedArg, 'CapturedArg should not be null');\n\n\t\tSystem.Assert.isInstanceOfType(capturedArg, TestInnerClass.class, 'CapturedArg should be SObject, instead was ' + capturedArg);\n\n\t\tTestInnerClass testValueCaptured = (TestInnerClass)capturedArg;\n\n\t\tSystem.Assert.areEqual(4, testValueCaptured.i, 'the values inside the argument captured should be the same of the original one');\n\t\tSystem.Assert.areEqual('5', testValueCaptured.s, 'the values inside the argument captured should be the same of the original one');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureArgumentOnlyFromVerifiedMethod()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\t//the next call should be ignored because is not the method that has under verify,\n\t\t//even if have the same type specified in the capturer.\n\t\tmockList.addMore('Barney');\n\n\t\t// Then\n\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add((String) argument.capture());\n\n\t\tSystem.Assert.areEqual('Fred', (String)argument.getValue(), 'the argument captured is not as expected');\n\t\tSystem.Assert.areEqual(1, argument.getAllValues().size(), 'the argument captured should be only one');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArgumentsForTheVerifiedMethods()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\tList<String> stringList = new List<String> {'3'};\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add(stringList);\n\n\t\tmockList.clear();\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add((String) argument.capture());\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add((List<String>) argument.capture());\n\n\t\tSystem.Assert.areEqual(stringList, (List<String>)argument.getValue(), 'the argument captured is not as expected');\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(2, argsCaptured.size(), 'expected 2 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureArgumentFromRequestedParameter()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred', 'Barney', 'Wilma', 'Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList))\n\t\t\t.add(\n\t\t\t\t(String) fflib_Match.eq('Fred'),\n\t\t\t\t(String) fflib_Match.eq('Barney'),\n\t\t\t\t(String)  argument.capture(),\n\t\t\t\t(String) fflib_Match.eq('Betty'));\n\n\t\tSystem.Assert.areEqual('Wilma', (String)argument.getValue(),\n\t\t\t'the argument captured is not as expected, should be Wilma because is the 3rd parameter in the call');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureLastArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Barney');\n\t\tmockList.add('Fred');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add((String) argument.capture());\n\n\t\tSystem.Assert.areEqual('Fred', (String)argument.getValue(), 'the argument captured is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArguments()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add('Barney');\n\t\tmockList.add('Wilma');\n\t\tmockList.add('Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 4)).add((String) argument.capture());\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(4, argsCaptured.size(), 'expected 4 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[1], 'the second value is not as expected');\n\t\tSystem.Assert.areEqual('Wilma', (String) argsCaptured[2], 'the third value is not as expected');\n\t\tSystem.Assert.areEqual('Betty', (String) argsCaptured[3], 'the forth value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArgumentsFromMultipleMethods()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add('Barney');\n\t\tmockList.get2(3, 'pebble');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 2)).add((String) argument.capture());\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList))\n\t\t\t.get2(\n\t\t\t\t(Integer) fflib_Match.eq(3),\n\t\t\t\t(String) argument.capture());\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(3, argsCaptured.size(), 'expected 3 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[1], 'the second value is not as expected');\n\n\t\tSystem.Assert.areEqual('pebble', (String) argsCaptured[2], 'the third value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCanHandleMultipleCapturesInOneMethodCall()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred', 'Barney', 'Wilma', 'Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList))\n\t\t\t.add(\n\t\t\t\t(String) fflib_Match.eq('Fred'),\n\t\t\t\t(String)  argument.capture(),\n\t\t\t\t(String)  argument.capture(),\n\t\t\t\t(String) fflib_Match.eq('Betty'));\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(2, argsCaptured.size(), 'expected 2 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[0], 'the first value is not as expected');\n\n\t\tSystem.Assert.areEqual('Wilma', (String) argsCaptured[1], 'the second value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatDoesNotCaptureIfNotVerified()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('3');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(List<String>.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, fflib_ApexMocks.NEVER))\n\t\t\t.add((List<String>) argument.capture());\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(0, argsCaptured.size(), 'expected 0 argument to be captured');\n\n\t\tSystem.Assert.areEqual(null, argument.getValue(), 'no value should be captured, so must return null');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureOnlyMethodsThatMatchesWithOtherMatcherAsWell()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Same', 'Same', 'First call', 'First call');\n\t\tmockList.add('Same', 'Same', 'Second call', 'Second call');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(\n\t\t\tfflib_Match.eqString('Same'),\n\t\t\tfflib_Match.eqString('Same'),\n\t\t\t(String)argument.capture(),\n\t\t\tfflib_Match.eqString('First call'));\n\n\t\tSystem.Assert.areEqual('First call', (String)argument.getValue());\n\t}\n\n\t@isTest\n\tstatic void thatDoesNotCaptureAnythingWhenCaptorIsWrappedInAMatcher()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Same', 'Same', 'First call', 'First call');\n\t\tmockList.add('Same', 'Same', 'Second call', 'Second call');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList)).add(\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\targument.capture()),\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\targument.capture()),\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\targument.capture(),\n\t\t\t\tfflib_Match.eqString('First call')),\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\targument.capture(),\n\t\t\t\tfflib_Match.eqString('First call'))\n\t\t\t);\n\n\t\tList<Object> capturedValues = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(0, capturedValues.size(),\n\t\t\t'nothing should have been capture because the matcher it not really a capture type, but a allOf()');\n\t\tSystem.Assert.isNull((String)argument.getValue(),\n\t\t\t'nothing should have been capture because the matcher it not really a capture type, but a allOf()');\n\t}\n\n\t@isTest\n\tstatic void thatArgumentValueIsCapturedWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\t\t// When\n\t\tmockList.add('Fred');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList)inOrder1.verify(mockList, mocks.calls(1))).add((String) argument.capture());\n\n\t\tSystem.Assert.areEqual('Fred', (String)argument.getValue(), 'the argument captured is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCanPerformFurtherAssertionsOnCapturedArgumentValueWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t//When\n\t\tTestInnerClass testValue = new TestInnerClass();\n\t\ttestValue.i = 4;\n\t\ttestValue.s = '5';\n\n\t\tmockList.set(1, testValue);\n\n\t\t//Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(TestInnerClass.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1))).set(fflib_Match.anyInteger(),  argument.capture());\n\n\t\tObject capturedArg = argument.getValue();\n\t\tSystem.Assert.areNotEqual(null, capturedArg, 'CapturedArg should not be null');\n\n\t\tSystem.Assert.isInstanceOfType(capturedArg, TestInnerClass.class, 'CapturedArg should be SObject, instead was ' + capturedArg);\n\n\t\tTestInnerClass testValueCaptured = (TestInnerClass)capturedArg;\n\n\t\tSystem.Assert.areEqual(4, testValueCaptured.i, 'the values inside the argument captured should be the same of the original one');\n\t\tSystem.Assert.areEqual('5', testValueCaptured.s, 'the values inside the argument captured should be the same of the original one');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureArgumentOnlyFromVerifiedMethodWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\t//the next call should be ignored because is not the method that has under verify,\n\t\t//even if have the same type specified in the capturer.\n\t\tmockList.addMore('Barney');\n\n\t\t// Then\n\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1))).add((String) argument.capture());\n\n\t\tSystem.Assert.areEqual('Fred', (String)argument.getValue(), 'the argument captured is not as expected');\n\t\tSystem.Assert.areEqual(1, argument.getAllValues().size(), 'the argument captured should be only one');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArgumentsForTheVerifiedMethodsWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\tList<String> stringList = new List<String> {'3'};\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add(stringList);\n\n\t\tmockList.clear();\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1))).add((String) argument.capture());\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1))).add((List<String>) argument.capture());\n\n\t\tSystem.Assert.areEqual(stringList, (List<String>)argument.getValue(), 'the argument captured is not as expected');\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(2, argsCaptured.size(), 'expected 2 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureArgumentFromRequestedParameterWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Fred', 'Barney', 'Wilma', 'Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1)))\n\t\t\t.add(\n\t\t\t\t(String) fflib_Match.eq('Fred'),\n\t\t\t\t(String) fflib_Match.eq('Barney'),\n\t\t\t\t(String)  argument.capture(),\n\t\t\t\t(String) fflib_Match.eq('Betty'));\n\n\t\tSystem.Assert.areEqual('Wilma', (String)argument.getValue(),\n\t\t\t'the argument captured is not as expected, should be Wilma because is the 3rd parameter in the call');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureLastArgumentWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Barney');\n\t\tmockList.add('Fred');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(2))).add((String) argument.capture());\n\n\t\tSystem.Assert.areEqual('Fred', (String)argument.getValue(), 'the argument captured is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArgumentsWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add('Barney');\n\t\tmockList.add('Wilma');\n\t\tmockList.add('Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(4))).add((String) argument.capture());\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(4, argsCaptured.size(), 'expected 4 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[1], 'the second value is not as expected');\n\t\tSystem.Assert.areEqual('Wilma', (String) argsCaptured[2], 'the third value is not as expected');\n\t\tSystem.Assert.areEqual('Betty', (String) argsCaptured[3], 'the forth value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArgumentsFromMultipleMethodsWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add('Barney');\n\t\tmockList.get2(3, 'pebble');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(2))).add((String) argument.capture());\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1)))\n\t\t\t.get2(\n\t\t\t\t(Integer) fflib_Match.eq(3),\n\t\t\t\t(String) argument.capture());\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(3, argsCaptured.size(), 'expected 3 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[1], 'the second value is not as expected');\n\n\t\tSystem.Assert.areEqual('pebble', (String) argsCaptured[2], 'the third value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatCanHandleMultipleCapturesInOneMethodCallWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Fred', 'Barney', 'Wilma', 'Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1)))\n\t\t\t.add(\n\t\t\t\t(String) fflib_Match.eq('Fred'),\n\t\t\t\t(String)  argument.capture(),\n\t\t\t\t(String)  argument.capture(),\n\t\t\t\t(String) fflib_Match.eq('Betty'));\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(2, argsCaptured.size(), 'expected 2 argument to be captured');\n\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[0], 'the first value is not as expected');\n\n\t\tSystem.Assert.areEqual('Wilma', (String) argsCaptured[1], 'the second value is not as expected');\n\t}\n\n\t@isTest\n\tstatic void thatDoesNotCaptureIfNotVerifiedWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('3');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(List<String>.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.never()))\n\t\t\t.add((List<String>) argument.capture());\n\n\t\tList<Object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(0, argsCaptured.size(), 'expected 0 argument to be captured');\n\n\t\tSystem.Assert.areEqual(null, argument.getValue(), 'no value should be captured, so must return null');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureOnlyMethodsThatMatchesWithOtherMatcherAsWellWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Same', 'Same', 'First call', 'First call');\n\t\tmockList.add('Same', 'Same', 'Second call', 'Second call');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1))).add(\n\t\t\tfflib_Match.eqString('Same'),\n\t\t\tfflib_Match.eqString('Same'),\n\t\t\t(String)argument.capture(),\n\t\t\tfflib_Match.eqString('First call'));\n\n\t\tSystem.Assert.areEqual('First call', (String)argument.getValue());\n\t}\n\n\t@isTest\n\tstatic void thatDoesNotCaptureAnythingWhenCaptorIsWrappedInAMatcherWithInOrderVerification()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(mocks, new List<Object>{ mockList });\n\n\n\t\t// When\n\t\tmockList.add('Same', 'Same', 'First call', 'First call');\n\t\tmockList.add('Same', 'Same', 'Second call', 'Second call');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) inOrder1.verify(mockList, mocks.calls(1))).add(\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\targument.capture()),\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\tfflib_Match.eqString('Same'),\n\t\t\t\targument.capture()),\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\targument.capture(),\n\t\t\t\tfflib_Match.eqString('First call')),\n\t\t\t(String) fflib_Match.allOf(\n\t\t\t\targument.capture(),\n\t\t\t\tfflib_Match.eqString('First call'))\n\t\t\t);\n\n\t\tList<Object> capturedValues = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(0, capturedValues.size(),\n\t\t\t'nothing should have been capture because the matcher it not really a capture type, but a allOf()');\n\t\tSystem.Assert.isNull((String)argument.getValue(),\n\t\t\t'nothing should have been capture because the matcher it not really a capture type, but a allOf()');\n\t}\n\n\t@isTest\n\tstatic void thatCaptureAllArgumentswhenMethodIsCalledWithTheSameArgument()\n\t{\n\t\t// Given\n\t\tfflib_ApexMocks mocks = new fflib_ApexMocks();\n\t\tfflib_MyList mockList = (fflib_MyList)mocks.mock(fflib_MyList.class);\n\n\t\t// When\n\t\tmockList.add('Fred');\n\t\tmockList.add('Barney');\n\t\tmockList.add('Wilma');\n\t\tmockList.add('Barney');\n\t\tmockList.add('Barney');\n\t\tmockList.add('Betty');\n\n\t\t// Then\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList) mocks.verify(mockList, 6)).add((String) argument.capture());\n\n\t\tList<object> argsCaptured = argument.getAllValues();\n\n\t\tSystem.Assert.areEqual(6, argsCaptured.size(), 'expected 6 arguments to be captured');\n\n\t\tSystem.Assert.areEqual('Fred', (String) argsCaptured[0], 'the first value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[1], 'the second value is not as expected');\n\t\tSystem.Assert.areEqual('Wilma', (String) argsCaptured[2], 'the third value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[3], 'the fourth value is not as expected');\n\t\tSystem.Assert.areEqual('Barney', (String) argsCaptured[4], 'the fifth value is not as expected');\n\t\tSystem.Assert.areEqual('Betty', (String) argsCaptured[5], 'the sixth value is not as expected');\n\t}\n\n\n\tprivate class TestInnerClass\n\t{\n\t\tpublic Integer i;\n\t\tpublic String s;\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_ArgumentCaptorTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_IDGeneratorTest.cls",
    "content": "/**\n * Copyright (c) 2014, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@isTest\nprivate class fflib_IDGeneratorTest\n{\n\t@isTest\n\tstatic void itShouldGenerateValidIDs()\n\t{\n\t\tString id1 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id2 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id3 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id4 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id5 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id6 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id7 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id8 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id9 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id10 = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tString id11 = fflib_IDGenerator.generate(Account.SObjectType);\n\n\t\tSystem.Assert.areEqual('001000000000001AAA', id1);\n\t\tSystem.Assert.areEqual('001000000000002AAA', id2);\n\t\tSystem.Assert.areEqual('001000000000003AAA', id3);\n\t\tSystem.Assert.areEqual('001000000000004AAA', id4);\n\t\tSystem.Assert.areEqual('001000000000005AAA', id5);\n\t\tSystem.Assert.areEqual('001000000000006AAA', id6);\n\t\tSystem.Assert.areEqual('001000000000007AAA', id7);\n\t\tSystem.Assert.areEqual('001000000000008AAA', id8);\n\t\tSystem.Assert.areEqual('001000000000009AAA', id9);\n\t\tSystem.Assert.areEqual('001000000000010AAA', id10);\n\t\tSystem.Assert.areEqual('001000000000011AAA', id11);\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_IDGeneratorTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_InOrderTest.cls",
    "content": "/*\n Copyright (c) 2014-2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n@isTest\nprivate class fflib_InOrderTest\n{\n\tprivate static fflib_ApexMocks MY_MOCKS = new fflib_ApexMocks();\n\n\t@isTest\n\tstatic void thatVerifyInOrderAllTheMethodsCalled()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-2');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-3');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-4');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-2');\n\t\t\tSystem.Assert.fail('It should fail because 1-2 is in the wrong order');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException error)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"1-2\"), (\"1-3\"), (\"1-4\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-2\"',\n\t\t\t\terror.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderDifferentMethodsCalledWithSameArguments()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.addMore('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.addMore('1-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.addMore('1-3');\n\t\tfirstMock.add('1-4');\n\t\tfirstMock.addMore('1-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).addMore('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).addMore('1-3');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-4');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderDifferentMethodsCalledWithSameArgumentsOrderFail()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.addMore('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.addMore('1-2');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).addMore('1-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t\tSystem.Assert.fail('It should fail because 1-1 is called before the addMore(1-1)');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException error)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"1-1\"), (\"1-2\"), (\"1-2\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\terror.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderDifferentMethodsCalledWithSameArgumentsDoubleCallFail()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.addMore('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.addMore('1-2');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).addMore('1-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).addMore('1-1');\n\t\t\tSystem.Assert.fail('It should fail because addMore(1-1) is called only Once');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException error)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.addMore(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"1-1\"), (\"1-2\"), (\"1-2\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\terror.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCallMethodWithMatches()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-0');\n\t\tfirstMock.add('1-11');\n\t\tfirstMock.add('1-12');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(2))).add(fflib_Match.stringStartsWith('1-1'));\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-4');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCallMethodWithMatchesFailsIfVerifyACallAlreadyInTheMatcher()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-0');\n\t\tfirstMock.add('1-11');\n\t\tfirstMock.add('1-12');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(2))).add(fflib_Match.stringStartsWith('1-1'));\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-4');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-11');\n\t\t\tSystem.Assert.fail('It should fail because addMore(1-11) has been already verified using the matchers');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException error)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-0\"), (\"1-11\"), (\"1-12\"), (\"1-3\"), (\"1-4\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-11\"',\n\t\t\t\terror.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCallMethodWithMultipleMatches()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\n\t\tfirstMock.add('1-0');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\n\t\tfirstMock.add('2-0');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('2-3');\n\t\tfirstMock.add('2-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(4))).add(fflib_Match.stringStartsWith('1-'));\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(4))).add(fflib_Match.stringStartsWith('2-'));\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCallMethodWithMultipleMatchesMixed()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('2-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('2-3');\n\t\tfirstMock.add('1-4');\n\t\tfirstMock.add('2-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(4))).add(fflib_Match.stringStartsWith('1-'));\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add(fflib_Match.stringStartsWith('2-'));\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCallMethodWithMultipleMatchesMixedFailWhenMatcherHaveAlreadyVerifiedMethod()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('2-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('2-3');\n\t\tfirstMock.add('1-4');\n\t\tfirstMock.add('2-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(4))).add(fflib_Match.stringStartsWith('1-'));\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(4))).add('1-11');\n\t\t\tSystem.Assert.fail('It should fail because only one call for the 2- is available to verify');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException error)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 4 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-2\"), (\"2-2\"), (\"1-3\"), (\"2-3\"), (\"1-4\"), (\"2-4\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-11\"',\n\t\t\t\terror.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCanSkipMethodsCalledUntilFindTheOneThatNeedsVerify()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-4');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-2');\n\t\t\tSystem.Assert.fail('It should fail because is out of order');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException error)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"1-2\"), (\"1-3\"), (\"1-4\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-2\"',\n\t\t\t\terror.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCanHandleMultipleMethodsCalls()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(3))).add('1-2');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-4');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCanHandleMultipleMethodsCallsAndNotFailsIfVerifyCountIsGreaterThenExpected()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(2))).add('1-2');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCanHandleMultipleMethodsCallsButFailsIfVerifyCountIsLessThenExpected()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-2');\n\t\tfirstMock.add('1-3');\n\t\tfirstMock.add('1-4');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(4))).add('1-2');\n\t\t\tSystem.Assert.fail('It should fail because is actually called only 3 times');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 4 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 3'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"1-2\"), (\"1-2\"), (\"1-2\"), (\"1-3\"), (\"1-4\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-2\"',\n\t\t\t\te.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCanHandleMultipleMocks()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList secondMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList thirdMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\n\t\tfflib_InOrder inOrder = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock, secondMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tsecondMock.add('2-1');\n\t\tthirdMock.add('3-1');\n\n\t\tfirstMock.add('1-2');\n\t\tsecondMock.add('2-2');\n\t\tthirdMock.add('3-2');\n\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-3');\n\t\tsecondMock.add('2-3');\n\t\tthirdMock.add('3-3');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder.verify(secondMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder.verify(firstMock, MY_MOCKS.calls(1))).add('1-2');\n\t\t((fflib_MyList.IList)inOrder.verify(secondMock, MY_MOCKS.calls(1))).add('2-2');\n\t\t((fflib_MyList.IList)inOrder.verify(firstMock, MY_MOCKS.calls(1))).add('1-3');\n\t\t((fflib_MyList.IList)inOrder.verify(secondMock, MY_MOCKS.calls(1))).add('2-3');\n\n\t\t((fflib_MyList.IList)MY_MOCKS.verify(thirdMock, MY_MOCKS.times(3))).add(fflib_Match.stringStartsWith('3-'));\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderCanHandleMixedInOrderInstance()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList secondMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList thirdMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\t\tfflib_InOrder inOrder2 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock, secondMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tsecondMock.add('2-1');\n\t\tthirdMock.add('3-1');\n\n\t\tfirstMock.add('1-2');\n\t\tsecondMock.add('2-2');\n\t\tthirdMock.add('3-2');\n\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-3');\n\t\tsecondMock.add('2-3');\n\t\tthirdMock.add('3-3');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(2))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-3');\n\n\n\t\t((fflib_MyList.IList)inOrder2.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder2.verify(firstMock, MY_MOCKS.calls(1))).add('1-2');\n\t\t((fflib_MyList.IList)inOrder2.verify(secondMock, MY_MOCKS.calls(1))).add('2-2');\n\t\t((fflib_MyList.IList)inOrder2.verify(firstMock, MY_MOCKS.calls(1))).add('1-3');\n\t\t((fflib_MyList.IList)inOrder2.verify(secondMock, MY_MOCKS.calls(1))).add('2-3');\n\n\t\t((fflib_MyList.IList)MY_MOCKS.verify(thirdMock, MY_MOCKS.times(3))).add(fflib_Match.stringStartsWith('3-'));\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderThrownExceptionIfVerifyMockInstanceNotInTheSet()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList secondMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tsecondMock.add('2-1');\n\n\t\t// Then\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(secondMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t\tSystem.Assert.fail('An exception was expected, because this verify is not in the list of the mocks to verify');\n\t\t}\n\t\tcatch(fflib_ApexMocks.ApexMocksException mockexcep)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"2-1\"',\n\t\t\t\tmockexcep.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyInOrderThrownExceptionWithCustomMessage()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\tString customErrorMesage = 'Some custom error message';\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-2');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-2');\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.description(customErrorMesage))).add('1-1');\n\t\t\tSystem.Assert.fail('expected some exception ');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 0'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\nSome custom error message'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"1-2\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\te.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtMostThrowsExceptionBecauseNotImplemented()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atMost(3))).add('1-1');\n\t\t\tSystem.Assert.fail('an exception was expected because the method is not implemented for the InOrder class');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'The atMost method is not implemented for the fflib_InOrder class';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyBetweenThrowsExceptionBecauseNotImplemented()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.between(3, 5))).add('1-1');\n\t\t\tSystem.Assert.fail('an exception was expected because the method is not implemented for the InOrder class');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'The between method is not implemented for the fflib_InOrder class';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNever()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.never())).add('3-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNeverWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.never())).add(fflib_Match.stringStartsWith('3-'));\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNeverFailsWhenCalled()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.never())).add('1-1');\n\t\t\tSystem.Assert.fail('expected some exception because the method has been called');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 0 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 4'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\te.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNeverFailsWhenCalledWithMatchers()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.never())).add(fflib_Match.stringStartsWith('1-'));\n\t\t\tSystem.Assert.fail('expected some exception because the method has been called');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 0 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 4'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: [starts with \"1-\"]',\n\t\t\t\te.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyThrowsExceptionWhenCallsIsInvochedFromStandardMock()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList) MY_MOCKS.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t\tSystem.Assert.fail('an exception was expected because the method is only implemented for the InOrder class');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'The calls() method is available only in the InOrder Verification.';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNoMoreInteractionsFails()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1', '1-1', '1-1', '1-1');\n\t\tfirstMock.addMore('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1', '1-1', '1-1', '1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\tinOrder1.verifyNoMoreInteractions();\n\t\t\tSystem.Assert.fail('an exception was expected because there are other interactions');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'No more Interactions were expected after the ' + fflib_MyList.getStubClassName() + '.add(String, String, String, String) method.';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNoMoreInteractionsFailsWhenOnLyOneMethodLeft()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1', '1-1', '1-1', '1-1');\n\t\tfirstMock.addMore('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).addMore('2-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\tinOrder1.verifyNoMoreInteractions();\n\t\t\tSystem.Assert.fail('an exception was expected because there are other interactions');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'No more Interactions were expected after the ' + fflib_MyList.getStubClassName() + '.addMore(String) method.';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNoMoreInteractionsPass()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList secondMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\t\tfflib_InOrder inOrder2 = new fflib_InOrder(MY_MOCKS, new List<Object>{ secondMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tsecondMock.add('1-1');\n\t\tsecondMock.add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\n\t\tinOrder1.verifyNoMoreInteractions();\n\n\t\t((fflib_MyList.IList)inOrder2.verify(secondMock, MY_MOCKS.calls(2))).add('1-1');\n\n\t\tinOrder2.verifyNoMoreInteractions();\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNoMoreInteractionsFailsWhenNoInteracionOccurs()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\tinOrder1.verifyNoMoreInteractions();\n\t\t\tSystem.Assert.fail('an exception was expected because there are other interactions');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'No Interactions expected on this InOrder Mock instance!';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNoInteractionsFails()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\tinOrder1.verifyNoInteractions();\n\t\t\tSystem.Assert.fail('an exception was expected because there are other interactions');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tString expectedMessage = 'No Interactions expected on this InOrder Mock instance!';\n\t\t\tSystem.Assert.areEqual(expectedMessage, mockExcept.getMessage(), ' the error message is not as expected');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyNoInteractionsPass()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_MyList secondMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tsecondMock.add('1-2');\n\t\t//Then\n\t\tinOrder1.verifyNoInteractions();\n\t}\n\n\t@isTest\n\tstatic void thatStrictVerificationCanBePerformed()\n\t{\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('4-1');\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('4-1');\n\t}\n\n\t@isTest\n\tstatic void thatMixedVerificationDoNotInterfierWithOtherImplementationChecking()\n\t{\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('4-1');\n\t\t// Then\n\t\t((fflib_MyList.IList)MY_MOCKS.verify(firstMock, MY_MOCKS.times(2))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('4-1');\n\n\t\t((fflib_MyList.IList)MY_MOCKS.verify(firstMock, MY_MOCKS.times(2))).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastPassWithSameCallsOfAssertion()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\tfirstMock.add('2-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1'); //all consumed until there by -> verify(firstMock, MY_MOCKS.atLeast(3))).add('1-1');\n\t\tfirstMock.add('2-1'); //finally consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(3))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastPassWithMoreCallsThenAsserted()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\tfirstMock.add('2-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1'); //it verifies until here, but\n\t\tfirstMock.add('1-1'); //this is consumed as well\n\t\tfirstMock.add('2-1'); //finally consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(2))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastThrowsErrorIfCalledLessTimes()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\tfirstMock.add('2-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1'); //there are then only 3 calls available, the assert 4 would fail\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(4))).add('1-1');\n\t\t\tSystem.Assert.fail('an exception was expected because the atLeast is asserting for 4 calls when instead there are only 3 not consumed calls');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 4 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 3'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastConsumeAllTheInstances()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\tfirstMock.add('2-1'); //consumed by -> verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1'); // the verify atLeast(2) it verifies until here, but it keep going through the instances\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1'); //so this would fail because have to first consume all the instances of the ('1-1')\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(2))).add('1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t\tSystem.Assert.fail('an exception was expected because the atLeast have consumed all the interactions of 1-1');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"2-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastConsumeAllTheInstancesForOnlyTheMethodVerified()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1'); // verify(firstMock, MY_MOCKS.atLeast(2))).add('2-1'); consume until here\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1'); //those are then free for the second atLeast assertion\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(2))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(2))).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastOnce()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeastOnce())).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastOnceConsumesInstancesUntilLastMethodVerified()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1'); // consumed until there by -> verify(firstMock, MY_MOCKS.atLeastOnce())).add('1-1');\n\t\tfirstMock.add('2-1'); // free for another assertion\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeastOnce())).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeastOnce())).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastOnceThrowsErrorIfCalledLessTimes()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeastOnce())).add('1-3');\n\t\t\tSystem.Assert.fail('an exception was expected because the atLeastOnce is asserting for 1 calls when instead the method is not called at all with that argument');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-3\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastOnceConsumesAllTheInstances()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1'); //all the instance have been consumed\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeastOnce())).add('1-1');\n\n\t\t// Then\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t\tSystem.Assert.fail('an exception was expected because the atLeast have consumed all the interactions of 1-1');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"2-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimes()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(3))).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesThrowsExceptionIfCalledMoreTimesThanExpected()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(2))).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 2 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 3'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesThrowsExceptionIfCalledLessTimesThanExpected()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(4))).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 4 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 3'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesPassWhenAnotherMethodIsCalledBetweenMethodsCalls()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(4))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesPassWhenAnotherMethodIsCalledBetweenMethodsCalls2()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(3))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesPassWhenAnotherMethodIsCalledBetweenMethodsCalls3()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(3))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(2))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesPassWhenAnotherMethodIsCalledBetweenMethodsCalls4()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(5))).add('1-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyTimesThrowsExceptionWhenAnotherMethodIsCalledBetweenMethodsCalls()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(5))).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 5 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 4'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatStrictVerificationCanBeEnforced()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(3))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(1))).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatTimesOneIsTheDefaultVerification()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 4'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatWithOldNotation()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 3)).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatWithOldNotationThrowsExceptionIfCalledMoreTimesThanExpected()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 2)).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 2 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 3'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatWithOldNotationThrowsExceptionIfCalledLessTimesThanExpected()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 4)).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 4 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 3'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatWithOldNotationPassWhenAnotherMethodIsCalledBetweenMethodsCalls()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 4)).add('1-1');\n\t}\n\n\t@isTest\n\tstatic void thatWithOldNotationThrowsExceptionWhenAnotherMethodIsCalledBetweenMethodsCalls()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 5)).add('1-1');\n\t\t\tSystem.Assert.fail('exception expected because the method is called more times than expected in the verification');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 5 in order'\n\t\t\t\t+ '\\nACTUAL COUNT: 4'\n\t\t\t\t+ '\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nACTUAL ARGS: (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\"), (\"1-1\"), (\"2-1\")'\n\t\t\t\t+ '\\n---'\n\t\t\t\t+ '\\nEXPECTED ARGS: \"1-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void thatStrictVerificationCanBeEnforcedWithOldNotation()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 1)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 1)).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 3)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 1)).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 1)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 1)).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatStrictVerificationCanBeEnforcedWithOldNotationUsingDefaultTimesOne()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t// When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, 3)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('2-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('1-1');\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock)).add('2-1');\n\t}\n\n\t@isTest\n\tstatic void thatVerifyAtLeastConsumesAllTheInstances2()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t//When\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('1-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('2-1');\n\t\tfirstMock.add('1-1');\n\n\t\t// Then\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(2))).add('1-1');\n\n\t\ttry\n\t\t{\n\t\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(1))).add('2-1');\n\t\t\tSystem.Assert.fail('exception expected because the atLeast have consumed all the calls');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException mockExcept)\n\t\t{\n\t\t\tSystem.Assert.areEqual('EXPECTED COUNT: 1 in order'\n\t\t\t\t+'\\nACTUAL COUNT: 0'\n\t\t\t\t+'\\nMETHOD: fflib_MyList__sfdc_ApexStub.add(String)'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nACTUAL ARGS: (\"1-1\"), (\"1-1\"), (\"1-1\"), (\"2-1\"), (\"2-1\"), (\"2-1\"), (\"2-1\"), (\"2-1\"), (\"1-1\")'\n\t\t\t\t+'\\n---'\n\t\t\t\t+'\\nEXPECTED ARGS: \"2-1\"',\n\t\t\t\tmockExcept.getMessage(),\n\t\t\t\t'Unexpected verify fail message');\n\t\t}\n\t}\n\n\t@isTest\n\tstatic void verifyAtLeastAndCapture()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t//When\n\t\tfirstMock.get2(1, '1-1');\n\t\tfirstMock.get2(2, '2-1');\n\t\tfirstMock.get2(1, '3-1');\n\t\tfirstMock.get2(1, '4-1');\n\t\tfirstMock.get2(2, '5-1');\n\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.atLeast(2))).get2( fflib_Match.eqInteger(1), (String) argument.capture());\n\n\t\tSystem.Assert.areEqual('4-1', (string) argument.getValue(), 'the last value captured is not as expected');\n\t}\n\n\t@isTest\n\tstatic void verifyTimesAndCaptor()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t//When\n\t\tfirstMock.get2(1, '1-1');\n\t\tfirstMock.get2(2, '1-2');\n\t\tfirstMock.get2(1, '2-1');\n\t\tfirstMock.get2(2, '2-2');\n\t\tfirstMock.get2(1, '3-1');\n\t\tfirstMock.get2(2, '3-2');\n\t\tfirstMock.get2(1, '4-1');\n\t\tfirstMock.get2(2, '4-2');\n\t\tfirstMock.get2(1, '5-1');\n\t\tfirstMock.get2(2, '5-2');\n\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.times(5))).get2(fflib_Match.eqInteger(1), (String) argument.capture());\n\n\t\tSystem.Assert.areEqual('5-1', (string) argument.getValue(), 'the last value captured is not as expected');\n\t}\n\n\t@isTest\n\tstatic void verifyCallsAndCapture()\n\t{\n\t\t// Given\n\t\tfflib_MyList firstMock = (fflib_MyList)MY_MOCKS.mock(fflib_MyList.class);\n\t\tfflib_InOrder inOrder1 = new fflib_InOrder(MY_MOCKS, new List<Object>{ firstMock });\n\n\t\t//When\n\t\tfirstMock.get2(1, '1-1');\n\t\tfirstMock.get2(2, '1-2');\n\t\tfirstMock.get2(1, '2-1');\n\t\tfirstMock.get2(2, '2-2');\n\t\tfirstMock.get2(1, '3-1');\n\t\tfirstMock.get2(2, '3-2');\n\t\tfirstMock.get2(1, '4-1');\n\t\tfirstMock.get2(2, '4-2');\n\t\tfirstMock.get2(1, '5-1');\n\t\tfirstMock.get2(2, '5-2');\n\n\t\tfflib_ArgumentCaptor argument = fflib_ArgumentCaptor.forClass(String.class);\n\n\t\t((fflib_MyList.IList)inOrder1.verify(firstMock, MY_MOCKS.calls(2))).get2(fflib_Match.eqInteger(1), (String) argument.capture());\n\n\t\tSystem.Assert.areEqual('2-1', (string) argument.getValue(), 'the last value captured is not as expected');\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_InOrderTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_InheritorTest.cls",
    "content": "/*\n * Copyright (c) 2016-2017 FinancialForce.com, inc.  All rights reserved.\n */\n@isTest\npublic class fflib_InheritorTest\n{\n \t@isTest\n    public static void canInstantiateMultipleInterfaceInheritor()\n    {\n        fflib_ApexMocks mocks = new fflib_ApexMocks();\n        Object inheritor = mocks.mock(fflib_Inheritor.class);\n        System.Assert.isInstanceOfType(inheritor, fflib_Inheritor.IA.class);\n        System.Assert.isInstanceOfType(inheritor, fflib_Inheritor.IB.class);\n        System.Assert.isInstanceOfType(inheritor, fflib_Inheritor.IC.class);\n    }\n\n \t@isTest\n    public static void canStubMultipleInterfaceInheritor()\n    {\n        fflib_ApexMocks mocks = new fflib_ApexMocks();\n        fflib_Inheritor inheritor = (fflib_Inheritor)mocks.mock(fflib_Inheritor.class);\n\n        mocks.startStubbing();\n        mocks.when(inheritor.doA()).thenReturn('Did not do A');\n        mocks.when(inheritor.doB()).thenReturn('Did not do B');\n        mocks.when(inheritor.doC()).thenReturn('Did not do C');\n        mocks.stopStubbing();\n        \n        System.Assert.areEqual('Did not do A', inheritor.doA());\n        System.Assert.areEqual('Did not do B', inheritor.doB());\n        System.Assert.areEqual('Did not do C', inheritor.doC());\n    }\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_InheritorTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MatchTest.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@isTest\npublic with sharing class fflib_MatchTest\n{\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithOneMatchReturnsTrue()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues argValues = new fflib_MethodArgValues(new List<Object>{ null });\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{ new AlwaysMatch() };\n\t\t\n\t\t//When\n\t\tBoolean match = fflib_Match.matchesAllArgs(argValues, targetMatchers);\n\n\t\t//Then\n\t\tSystem.Assert.isTrue(match);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithManyMatchesReturnsTrue()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues argValues = new fflib_MethodArgValues(new List<Object>{\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull\n\t\t});\n\t\t\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{\n\t\t\tnew AlwaysMatch(),\n\t\t\tnew AlwaysMatch(),\n\t\t\tnew AlwaysMatch(),\n\t\t\tnew AlwaysMatch()\n\t\t};\n\t\t\n\t\t//When\n\t\tBoolean match = fflib_Match.matchesAllArgs(argValues, targetMatchers);\n\n\t\t//Then\n\t\tSystem.Assert.isTrue(match);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithOneMismatchReturnsFalse()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues argValues = new fflib_MethodArgValues(new List<Object>{ null });\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{ new NeverMatch() };\n\t\t\n\t\t//When\n\t\tBoolean match = fflib_Match.matchesAllArgs(argValues, targetMatchers);\n\n\t\t//Then\n\t\tSystem.Assert.isFalse(match);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithManyMismatchesReturnsFalse()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues argValues = new fflib_MethodArgValues(new List<Object>{\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull\n\t\t});\n\t\t\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{\n\t\t\tnew NeverMatch(),\n\t\t\tnew NeverMatch(),\n\t\t\tnew NeverMatch(),\n\t\t\tnew NeverMatch()\n\t\t};\n\t\t\n\t\t//When\n\t\tBoolean match = fflib_Match.matchesAllArgs(argValues, targetMatchers);\n\n\t\t//Then\n\t\tSystem.Assert.isFalse(match);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithMatchesAndMismatchesReturnsFalse()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues argValues = new fflib_MethodArgValues(new List<Object>{\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull\n\t\t});\n\t\t\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{\n\t\t\tnew AlwaysMatch(),\n\t\t\tnew AlwaysMatch(),\n\t\t\tnew NeverMatch(),\n\t\t\tnew AlwaysMatch()\n\t\t};\n\t\t\n\t\t//When\n\t\tBoolean match = fflib_Match.matchesAllArgs(argValues, targetMatchers);\n\n\t\t//Then\n\t\tSystem.Assert.isFalse(match);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithNullMethodArgsThrowsException()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues methodArg = null;\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{ new AlwaysMatch() };\n\t\t\n\t\t//When\n\t\ttry\n\t\t{\n\t\t\tfflib_Match.matchesAllArgs(methodArg, targetMatchers);\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tSystem.Assert.areEqual('MethodArgs cannot be null', e.getMessage());\n\t\t}\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithNullMethodArgsArgValuesThrowsException()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues methodArg = new fflib_MethodArgValues(null);\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{ new AlwaysMatch() };\n\t\t\n\t\t//When\n\t\ttry\n\t\t{\n\t\t\tfflib_Match.matchesAllArgs(methodArg, targetMatchers);\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tSystem.Assert.areEqual('MethodArgs.argValues cannot be null', e.getMessage());\n\t\t}\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithNullMatchersThrowsException()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues methodArg = new fflib_MethodArgValues(new List<Object>{ 'Test' });\n\t\tList<fflib_IMatcher> targetMatchers = null;\n\t\t\n\t\t//When\n\t\ttry\n\t\t{\n\t\t\tfflib_Match.matchesAllArgs(methodArg, targetMatchers);\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tSystem.Assert.areEqual('Matchers cannot be null', e.getMessage());\n\t\t}\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesAllArgsWithDifferentSizeArgValuesAndMatchersThrowsException()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues methodArg = new fflib_MethodArgValues(new List<Object>{ 'Test' });\n\t\tList<fflib_IMatcher> targetMatchers = new List<fflib_IMatcher>{ new AlwaysMatch(), new AlwaysMatch() };\n\t\t\n\t\t//When\n\t\ttry\n\t\t{\n\t\t\tfflib_Match.matchesAllArgs(methodArg, targetMatchers);\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tString expectedMessage = 'MethodArgs and matchers must have the same count'\n\t\t\t\t+ ', MethodArgs: (' + methodArg.argValues.size() + ') ' + methodArg.argValues\n\t\t\t\t+ ', Matchers: (' + targetMatchers.size() + ') ' + targetMatchers;\n\n\t\t\tSystem.Assert.areEqual(expectedMessage, e.getMessage());\n\t\t}\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesWithOneMatcherSetsMatchingToTrue()\n\t{\n\t\t//Given\n\t\tfflib_IMatcher matcher = new AlwaysMatch();\n\t\t\n\t\t//When\n\t\tfflib_Match.matches(matcher);\n\t\t\n\t\t//Then\n\t\tSystem.Assert.isTrue(fflib_Match.Matching);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesWithOneMatcherRegistersMatcher()\n\t{\n\t\t//Given\n\t\tfflib_IMatcher matcher = new AlwaysMatch();\n\t\t\n\t\t//When\n\t\tfflib_Match.matches(matcher);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\t\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.areEqual(matcher, registeredMatchers[0]);\n\t}\n\t\n\t@isTest\n\tprivate static void whenMatchesWithOneMatcherReturnsNull()\n\t{\n\t\t//Given\n\t\tfflib_IMatcher matcher = new AlwaysMatch();\n\t\t\n\t\t//When\n\t\tObject retval = fflib_Match.matches(matcher);\n\t\t\n\t\t//Then\n\t\tSystem.Assert.areEqual(null, retval);\n\t}\n\n\t@isTest\n\tprivate static void allOfWithNoArgsThrowsException()\n\t{\n\t\t//Given/When\n\t\ttry\n\t\t{\n\t\t\tObject x = fflib_Match.allOf((List<Object>)null);\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tSystem.Assert.areEqual('Must register matchers to combine', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void allOfWithEmptyArgsThrowsException()\n\t{\n\t\t//Given/When\n\t\ttry\n\t\t{\n\t\t\tObject x = fflib_Match.allOf(new List<Object>{});\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tSystem.Assert.areEqual('Must register matchers to combine', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void allOfWithoutRegisteringInnerMatchersThrowsException()\n\t{\n\t\t//Given/When\n\t\ttry\n\t\t{\n\t\t\t//Should be using fflib_Match.allOf(new List<Object>{ fflib_Match.myMatcher('Hello') })\n\t\t\t//to register the inner matcher.\n\t\t\tObject x = fflib_Match.allOf(new List<Object>{ 'Hello' });\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\t//Then\n\t\t\tString expectedMessage = 'Error reclaiming inner matchers for combined matcher. '\n\t\t\t\t+ 'Wanted 1 matchers but only got ' + new List<fflib_IMatcher>();\n\t\t\tSystem.Assert.areEqual(expectedMessage, e.getMessage());\n\t\t}\n\t}\n\t\n\t@isTest\n\tprivate static void allOfWith2ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.allOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void allOfWith3ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.allOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'), fflib_Match.eq('hello3'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void allOfWith4ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.allOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'), fflib_Match.eq('hello3'), fflib_Match.eq('hello4'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void allOfWithListArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.allOf(new List<Object>{ fflib_Match.eq('hello') });\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void anyOfWith2ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.anyOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void anyOfWith3ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.anyOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'), fflib_Match.eq('hello3'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void anyOfWith4ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.anyOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'), fflib_Match.eq('hello3'), fflib_Match.eq('hello4'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void anyOfWithListArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.anyOf(new List<Object>{ fflib_Match.eq('hello') });\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void isNotRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.isNot(fflib_Match.eq('hello1'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void noneOfWith2ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.noneOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void noneOfWith3ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.noneOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'), fflib_Match.eq('hello3'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void noneOfWith4ArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.noneOf(fflib_Match.eq('hello1'), fflib_Match.eq('hello2'), fflib_Match.eq('hello3'), fflib_Match.eq('hello4'));\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void noneOfWithListArgsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.noneOf(new List<Object>{ fflib_Match.eq('hello') });\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Combined.class);\n\t}\n\n\t@isTest\n\tprivate static void eqRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eq('hello');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqBooleanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqBoolean(true);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqDateRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqDate(Date.today());\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqDatetimeRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqDatetime(System.now());\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqDecimalRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqDecimal(123);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqDoubleRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqDouble(123);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqIdRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqId('001000000000001AAA');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqIntegerRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqInteger(123);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqListRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqList(new List<String>{ 'hello' });\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqLongRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqLong(123);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqSObjectFieldRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSchema.SObjectField f = Schema.getGlobalDescribe().get('Account').getDescribe().fields.getMap().get('Id');\n\t\tObject x = fflib_Match.eqSObjectField(f);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqSObjectTypeRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSchema.SObjectType ot = Schema.getGlobalDescribe().get('Account');\n\t\tObject x = fflib_Match.eqSObjectType(ot);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tpublic static void eqStringRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.eqString('hello');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.Eq.class);\n\t}\n\n\t@isTest\n\tprivate static void refEqRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.refEq('hello');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.RefEq.class);\n\t}\n\n\t@isTest\n\tprivate static void anyBooleanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tBoolean x = fflib_Match.anyBoolean();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyBoolean.class);\n\t}\n\n\t@isTest\n\tprivate static void anyDateRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDate x = fflib_Match.anyDate();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyDate.class);\n\t}\n\n\t@isTest\n\tprivate static void anyDatetimeRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDatetime x = fflib_Match.anyDatetime();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyDatetime.class);\n\t}\n\n\t@isTest\n\tprivate static void anyDecimalRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDecimal x = fflib_Match.anyDecimal();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyDecimal.class);\n\t}\n\n\t@isTest\n\tprivate static void anyDoubleRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDouble x = fflib_Match.anyDouble();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyDouble.class);\n\t}\n\n\t@isTest\n\tprivate static void anyFieldSetRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSchema.FieldSet x = fflib_Match.anyFieldSet();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyFieldSet.class);\n\t}\n\n\t@isTest\n\tprivate static void anyIdRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tId x = fflib_Match.anyId();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyId.class);\n\t}\n\n\t@isTest\n\tprivate static void anyIntegerRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tInteger x = fflib_Match.anyInteger();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyInteger.class);\n\t}\n\n\t@isTest\n\tprivate static void anyListRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tList<Object> x = fflib_Match.anyList();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyList.class);\n\t}\n\n\t@isTest\n\tprivate static void anyLongRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tLong x = fflib_Match.anyLong();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyLong.class);\n\t}\n\n\t@isTest\n\tprivate static void anyObjectRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.anyObject();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyObject.class);\n\t}\n\n\t@isTest\n\tprivate static void anyStringRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.anyString();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnyString.class);\n\t}\n\n\t@isTest\n\tprivate static void anySObjectRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSObject x = fflib_Match.anySObject();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnySObject.class);\n\t}\n\n\t@isTest\n\tprivate static void anySObjectFieldRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSObjectField x = fflib_Match.anySObjectField();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnySObjectField.class);\n\t}\n\n\t@isTest\n\tprivate static void anySObjectTypeRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSObjectType x = fflib_Match.anySObjectType();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.AnySObjectType.class);\n\t}\n\n\t@isTest\n\tprivate static void dateAfterRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDate x = fflib_Match.dateAfter(Date.today());\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DatetimeAfter.class);\n\t}\n\n\t@isTest\n\tprivate static void dateBeforeRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDate x = fflib_Match.dateBefore(Date.today());\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DatetimeBefore.class);\n\t}\n\n\t@isTest\n\tprivate static void dateBetweenRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDate x = fflib_Match.dateBetween(Date.today(), Date.today());\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DatetimeBetween.class);\n\t}\n\n\t@isTest\n\tprivate static void datetimeAfterRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDatetime x = fflib_Match.datetimeAfter(System.now());\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DatetimeAfter.class);\n\t}\n\n\t@isTest\n\tprivate static void datetimeBeforeRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDatetime x = fflib_Match.datetimeBefore(System.now());\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DatetimeBefore.class);\n\t}\n\n\t@isTest\n\tprivate static void datetimeBetweenRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDatetime x = fflib_Match.datetimeBetween(System.now(), System.now());\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DatetimeBetween.class);\n\t}\n\n\t@isTest\n\tprivate static void decimalBetweenRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDecimal x = fflib_Match.decimalBetween(0, 10);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalBetween.class);\n\t}\n\n\t@isTest\n\tprivate static void decimalLessThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDecimal x = fflib_Match.decimalLessThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalLessThan.class);\n\t}\n\n\t@isTest\n\tprivate static void decimalMoreThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDecimal x = fflib_Match.decimalMoreThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalMoreThan.class);\n\t}\n\n\t@isTest\n\tprivate static void doubleBetweenRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDouble x = fflib_Match.doubleBetween(0, 10);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalBetween.class);\n\t}\n\n\t@isTest\n\tprivate static void doubleLessThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDouble x = fflib_Match.doubleLessThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalLessThan.class);\n\t}\n\n\t@isTest\n\tprivate static void doubleMoreThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tDouble x = fflib_Match.doubleMoreThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalMoreThan.class);\n\t}\n\n\t@isTest\n\tprivate static void fieldSetEquivalentWithNullFieldSetThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_Match.fieldSetEquivalentTo(null);\n\t\t\tSystem.Assert.fail('ExpectedException');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void fieldSetEquivalentToRegistersCorrectMatcherType()\n\t{\n\t\tSchema.FieldSet anyFieldSet = fflib_ApexMocksUtilsTest.findAnyFieldSet();\n\t\tif (anyFieldSet == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//Given/When\n\t\tSchema.FieldSet x = fflib_Match.fieldSetEquivalentTo(anyFieldSet);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.FieldSetEquivalentTo.class);\n\t}\n\n\t@isTest\n\tprivate static void integerBetweenRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tInteger x = fflib_Match.integerBetween(0, 10);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalBetween.class);\n\t}\n\n\t@isTest\n\tprivate static void integerLessThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tInteger x = fflib_Match.integerLessThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalLessThan.class);\n\t}\n\n\t@isTest\n\tprivate static void integerMoreThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tInteger x = fflib_Match.integerMoreThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalMoreThan.class);\n\t}\n\n\t@isTest\n\tprivate static void isNotNullRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.isNotNull();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.IsNotNull.class);\n\t}\n\n\t@isTest\n\tprivate static void isNullRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.isNull();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.IsNull.class);\n\t}\n\n\t@isTest\n\tprivate static void listContainsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.listContains('fred');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.ListContains.class);\n\t}\n\n\t@isTest\n\tprivate static void listIsEmptyRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tObject x = fflib_Match.listIsEmpty();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.ListIsEmpty.class);\n\t}\n\n\t@isTest\n\tprivate static void longBetweenRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tLong x = fflib_Match.longBetween(0, 10);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalBetween.class);\n\t}\n\n\t@isTest\n\tprivate static void longLessThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tLong x = fflib_Match.longLessThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalLessThan.class);\n\t}\n\n\t@isTest\n\tprivate static void longMoreThanRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tLong x = fflib_Match.longMoreThan(0);\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.DecimalMoreThan.class);\n\t}\n\n\t@isTest\n\tprivate static void sObjectOfTypeRegistersCorrectMatcherType()\n\t{\n\t\t//Given\n\t\tSchema.SObjectType ot = Schema.getGlobalDescribe().get('Account');\n\t\tif (ot == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//When\n\t\tSObject x = fflib_Match.sObjectOfType(ot);\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.SObjectOfType.class);\n\t}\n\n\t@isTest\n\tprivate static void sObjectWithRegistersCorrectMatcherType()\n\t{\n\t\t//Given\n\t\tSchema.SObjectType ot = Schema.getGlobalDescribe().get('Account');\n\t\tif (ot == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tSchema.SObjectField f = ot.getDescribe().fields.getMap().get('Id');\n\n\t\t//When\n\t\tSObject x = fflib_Match.sObjectWith(new Map<Schema.SObjectField, Object>{ f=>null });\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.SObjectWith.class);\n\t}\n\n    @isTest\n\tprivate static void sObjectsWithRegistersCorrectMatcherType()\n\t{\n\t\t//Given\n\t\tSchema.SObjectType ot = Schema.getGlobalDescribe().get('Account');\n\t\tif (ot == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tSchema.SObjectField f = ot.getDescribe().fields.getMap().get('Id');\n\n\t\t//When\n\t\tSObject[] x = fflib_Match.sObjectsWith(new list<Map<Schema.SObjectField, Object>>{ \n            new map<Schema.SObjectField,Object> {f=>null}\n        \t});\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.SObjectsWith.class);\n\t}\n\n    @isTest\n\tprivate static void sObjectsWithMatchInOrderRegistersCorrectMatcherType()\n\t{\n\t\t//Given\n\t\tSchema.SObjectType ot = Schema.getGlobalDescribe().get('Account');\n\t\tif (ot == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tSchema.SObjectField f = ot.getDescribe().fields.getMap().get('Id');\n\n\t\t//When\n\t\tSObject[] x = fflib_Match.sObjectsWith(new list<Map<Schema.SObjectField, Object>>{ \n            new map<Schema.SObjectField,Object> {f=>null}\n        \t}, false);\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.SObjectsWith.class, String.valueOf(registeredMatchers));\n\t}\n    \n\t@isTest\n\tprivate static void sObjectWithIdRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSObject x = fflib_Match.sObjectWithId('001000000000001AAA');\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.SObjectWithId.class);\n\t}\n\n\t@isTest\n\tprivate static void sObjectWithNameRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tSObject x = fflib_Match.sObjectWithName('hello');\n\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.SObjectWithName.class);\n\t}\n\n\t@isTest\n\tprivate static void stringContainsRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.stringContains('hello');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.StringContains.class);\n\t}\n\n\t@isTest\n\tprivate static void stringEndsWithRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.stringEndsWith('hello');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.StringEndsWith.class);\n\t}\n\n\t@isTest\n\tprivate static void stringIsBlankRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.stringIsBlank();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.StringIsBlank.class);\n\t}\n\n\t@isTest\n\tprivate static void stringIsNotBlankRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.stringIsNotBlank();\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.StringIsNotBlank.class);\n\t}\n\n\t@isTest\n\tprivate static void stringMatchesRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.stringMatches('[a-z]*');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.StringMatches.class);\n\t}\n\n\t@isTest\n\tprivate static void stringStartsWithRegistersCorrectMatcherType()\n\t{\n\t\t//Given/When\n\t\tString x = fflib_Match.stringStartsWith('hello');\n\t\t\n\t\t//Then\n\t\tList<fflib_IMatcher> registeredMatchers = fflib_Match.getAndClearMatchers(1);\n\t\tSystem.Assert.areNotEqual(null, registeredMatchers);\n\t\tSystem.Assert.areEqual(1, registeredMatchers.size());\n\t\tSystem.Assert.isInstanceOfType(registeredMatchers[0], fflib_MatcherDefinitions.StringStartsWith.class);\n\t}\n\n\tprivate class AlwaysMatch implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tprivate class NeverMatch implements fflib_IMatcher\n\t{\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MatchTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MatcherDefinitionsTest.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n @isTest\npublic class fflib_MatcherDefinitionsTest\n{\n\tprivate static final List<fflib_IMatcher> INTERNAL_MATCHERS = new List<fflib_IMatcher>{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew fflib_MatcherDefinitions.StringContains('bob'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew fflib_MatcherDefinitions.StringContains('tom'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew fflib_MatcherDefinitions.StringContains('fred')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t};\n\n\tprivate static final Date TODAY = System.today();\n\tprivate static final Datetime NOW = System.now();\n\n\tprivate static final SObject ACCOUNT_RECORD;\n\tprivate static final Schema.SObjectType ACCOUNT_OBJECT_TYPE;\n\tprivate static final Schema.SObjectType OPPORTUNITY_OBJECT_TYPE;\n\tprivate static final Schema.SobjectType GROUP_OBJECT_TYPE;\n\tprivate static final Sobject[] GROUP_RECORDS;\n\t\n\tstatic\n\t{\n\t\tMap<String, Schema.SObjectType> globalDescribe = Schema.getGlobalDescribe();\n\n\t\tACCOUNT_OBJECT_TYPE = globalDescribe.get('Account');\n\t\tOPPORTUNITY_OBJECT_TYPE = globalDescribe.get('Opportunity');\n\t\tGROUP_OBJECT_TYPE = globalDescribe.get('Group');\n\t\t\n\t\tSObject accountRecord = ACCOUNT_OBJECT_TYPE.newSObject();\n\t\taccountRecord.put('Name', 'MatcherDefinitionTestAccount' + System.now());\n\t\taccountRecord.Id = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tACCOUNT_RECORD = accountRecord;\n        \n\t\tGROUP_RECORDS = new list<Group> {\n\t\t\tnew Group(Name = 'MatcherDefnTestGroup0'+System.now(), DeveloperName='MatcherDefnTestGroup0'+System.now().getTime(),Type='Queue'),\n\t\t\tnew Group(Name = 'MatcherDefnTestGroup1'+System.now(), DeveloperName='MatcherDefnTestGroup1'+System.now().getTime(),Type='Queue')\n\t\t};\n\t\tinsert GROUP_RECORDS;    \n        \n\t}\n\n\t@isTest\n\tprivate static void whenConstructingCombinedWithNullConnectiveExpressionShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Combined(null, INTERNAL_MATCHERS);\n\t\t\tSystem.Assert.fail('Expecting exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Invalid connective expression: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenConstructingCombinedWithNullInternalMatchersShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.ALL, null);\n\t\t\tSystem.Assert.fail('Expecting exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Invalid inner matchers: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenConstructingCombinedWithEmptyInternalMatchersShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.ALL, new List<fflib_IMatcher>());\n\t\t\tSystem.Assert.fail('Expecting exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Invalid inner matchers: ()', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenCombinedMatchesWithAllExpressionShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.ALL, INTERNAL_MATCHERS);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('ted'));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches('tomfred'));\n\t\tSystem.Assert.isTrue(matcher.matches('bobtomfred'));\n\t}\n\n\t@isTest\n\tprivate static void whenCombinedMatchesWithAtLeastOneExpressionShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.AT_LEAST_ONE, INTERNAL_MATCHERS);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('ted'));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches('tomfred'));\n\t\tSystem.Assert.isTrue(matcher.matches('bobtomfred'));\n\t}\n\n\t@isTest\n\tprivate static void whenCombinedMatchesWithNoneExpressionShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.NONE, INTERNAL_MATCHERS);\n\t\tSystem.Assert.isTrue(matcher.matches(null));\n\t\tSystem.Assert.isTrue(matcher.matches('ted'));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches('tomfred'));\n\t\tSystem.Assert.isFalse(matcher.matches('bobtomfred'));\n\t}\n\n\t@isTest\n\tprivate static void whenCombinedMatcherToStringReturnsExpectedString()\n\t{\n\t\tList<fflib_IMatcher> innerMatchers = new List<fflib_IMatcher>{\n\t\t\tnew StringMatcher('one'),\n\t\t\tnew StringMatcher('two'),\n\t\t\tnew StringMatcher('three')\n\t\t};\n\n\t\tSystem.Assert.areEqual(\n\t\t\t'[any of: \"one\", \"two\", \"three\"]',\n\t\t\t'' + new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.AT_LEAST_ONE, innerMatchers)\n\t\t);\n\t\tSystem.Assert.areEqual(\n\t\t\t'[all of: \"one\", \"two\", \"three\"]',\n\t\t\t'' + new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.ALL, innerMatchers)\n\t\t);\n\t\tSystem.Assert.areEqual(\n\t\t\t'[none of: \"one\", \"two\", \"three\"]',\n\t\t\t'' + new fflib_MatcherDefinitions.Combined(fflib_MatcherDefinitions.Connective.NONE, innerMatchers)\n\t\t);\n\t}\n\n\t@isTest\n\tprivate static void constructEq_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.Eq(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenEqMatchesShouldReturnCorrectResults()\n\t{\n\t\tList<String> s1 = new List<String> {'bob', 'tom'};\n\t\tList<String> s2 = new List<String> {'bob', 'tom'};\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.Eq(s1);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(new List<String> {'bob'}));\n\t\tSystem.Assert.isTrue(matcher.matches(s2));\n\t\tSystem.Assert.isTrue(matcher.matches(s1));\n\t}\n\n\t@isTest\n\tprivate static void whenEqToStringShouldReturnExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[equals 1]', '' + new fflib_MatcherDefinitions.Eq(1));\n\t}\n\n\t@isTest\n\tprivate static void constructRefEq_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.RefEq(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenRefEqMatchesShouldReturnCorrectResults()\n\t{\n\t\tList<String> s1 = new List<String> {'bob', 'tom'};\n\t\tList<String> s2 = new List<String> {'bob', 'tom'};\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.RefEq(s1);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(s2));\n\t\tSystem.Assert.isTrue(matcher.matches(s1));\n\t}\n\n\t@isTest\n\tprivate static void whenRefEqToStringReturnsExpectedString()\n\t{\n        List<String> s1 = new List<String> {'bob', 'tom'};\n\t\tSystem.Assert.areEqual('[reference equals ' + JSON.serialize(s1, false) + ']', '' + new fflib_MatcherDefinitions.RefEq(s1));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyBooleanMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyBoolean();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(9));\n\t\tSystem.Assert.isTrue(matcher.matches(true));\n\t\tSystem.Assert.isTrue(matcher.matches(false));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyBooleanToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Boolean]', '' + new fflib_MatcherDefinitions.AnyBoolean());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDateMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyDate();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(TODAY));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDateToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Date]', '' + new fflib_MatcherDefinitions.AnyDate());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDatetimeMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyDatetime();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(TODAY));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDatetimeToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any DateTime]', '' + new fflib_MatcherDefinitions.AnyDatetime());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDecimalMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyDecimal();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(9));\n\t\tSystem.Assert.isTrue(matcher.matches(9L));\n\t\tSystem.Assert.isTrue(matcher.matches(9.99));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDecimalToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Decimal]', '' + new fflib_MatcherDefinitions.AnyDecimal());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDoubleMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyDouble();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(9));\n\t\tSystem.Assert.isTrue(matcher.matches(9L));\n\t\tSystem.Assert.isTrue(matcher.matches(9.99));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyDoubleToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Double]', '' + new fflib_MatcherDefinitions.AnyDouble());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyFieldSetMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyFieldSet();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\n\t\tSchema.FieldSet anyFieldSet = fflib_ApexMocksUtilsTest.findAnyFieldSet();\n\t\tif (anyFieldSet != null)\n\t\t{\n\t\t\tSystem.Assert.isTrue(matcher.matches(anyFieldSet));\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenAnyFieldSetToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any FieldSet]', '' + new fflib_MatcherDefinitions.AnyFieldSet());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyIdMatchesShouldReturnCorrectResults()\n\t{\n\t\tString idString = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tId accountId = fflib_IDGenerator.generate(Account.SObjectType);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyId();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(idString));\n\t\tSystem.Assert.isTrue(matcher.matches(accountId));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyIdToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Id]', '' + new fflib_MatcherDefinitions.AnyId());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyIntegerMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyInteger();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(9L));\n\t\tSystem.Assert.isFalse(matcher.matches(9.99));\n\t\tSystem.Assert.isTrue(matcher.matches(9));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyIntegerToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Integer]', '' + new fflib_MatcherDefinitions.AnyInteger());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyListMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyList();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(new List<String>()));\n\t\tSystem.Assert.isTrue(matcher.matches(new List<Integer>()));\n\t\tSystem.Assert.isTrue(matcher.matches(new List<Object>()));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyListToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any list]', '' + new fflib_MatcherDefinitions.AnyList());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyLongMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyLong();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(9.99));\n\t\tSystem.Assert.isTrue(matcher.matches(9));\n\t\tSystem.Assert.isTrue(matcher.matches(9L));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyLongToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Long]', '' + new fflib_MatcherDefinitions.AnyLong());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyObjectMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyObject();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(9));\n\t\tSystem.Assert.isTrue(matcher.matches(new List<String>()));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyObjectToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any Object]', '' + new fflib_MatcherDefinitions.AnyObject());\n\t}\n\n\t@isTest\n\tprivate static void whenAnyStringMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnyString();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(9));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t}\n\n\t@isTest\n\tprivate static void whenAnyStringToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any String]', '' + new fflib_MatcherDefinitions.AnyString());\n\t}\n\n\t@isTest\n\tprivate static void whenAnySObjectMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnySObject();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(new Account()));\n\t}\n\n\t@isTest\n\tprivate static void whenAnySObjectToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any SObject]', '' + new fflib_MatcherDefinitions.AnySObject());\n\t}\n\n\t@isTest\n\tprivate static void whenAnySObjectFieldMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnySObjectField();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(new Account()));\n\t\tSystem.Assert.isTrue(matcher.matches(Account.Id));\n\t}\n\n\t@isTest\n\tprivate static void whenAnySObjectFieldToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any SObjectField]', '' + new fflib_MatcherDefinitions.AnySObjectField());\n\t}\n\n\t@isTest\n\tprivate static void whenAnySObjectTypeMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.AnySObjectType();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(new Account()));\n\t\tSystem.Assert.isTrue(matcher.matches(Account.SObjectType));\n\t}\n\n\t@isTest\n\tprivate static void whenAnySObjectTypeToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[any SObjectType]', '' + new fflib_MatcherDefinitions.AnySObjectType());\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeAfter_WithNullFromDatetime_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeAfter(null, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeAfter_WithNullInclusive_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeAfter(System.now(), null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeAfterMatchesWithoutInclusiveShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeAfter(NOW, false);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(-1)));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW.addSeconds(1)));\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeAfterMatchesWithInclusiveShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeAfter(NOW, true);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(-1)));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW.addSeconds(1)));\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeAfterWithInclusiveToStringReturnsExpectedString()\n\t{\n\t\t// Given\n\t\tDateTime fromDate = DateTime.newInstanceGmt(2019, 1, 1, 12, 0, 0);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeAfter(fromDate, true);\n\n\t\t// When\n\t\tString actual = '' + matcher;\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('[on or after \"2019-01-01T12:00:00.000Z\"]', actual);\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeAfterWithNotInclusiveToStringReturnsExpectedString()\n\t{\n\t\t// Given\n\t\tDateTime fromDate = DateTime.newInstanceGmt(2019, 1, 1, 12, 0, 0);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeAfter(fromDate, false);\n\n\t\t// When\n\t\tString actual = '' + matcher;\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('[after \"2019-01-01T12:00:00.000Z\"]', actual);\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeBefore_WithNullToDatetime_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeBefore(null, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeBefore_WithNullInclusive_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeBefore(System.now(), null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBeforeMatchesWithoutInclusiveShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBefore(NOW, false);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(1)));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW.addSeconds(-1)));\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBeforeMatchesWithInclusiveShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBefore(NOW, true);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(1)));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW.addSeconds(-1)));\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBeforeWithInclusiveToStringReturnsExpectedString()\n\t{\n\t\t// Given\n\t\tDateTime toDate = DateTime.newInstanceGmt(2019, 1, 1, 12, 0, 0);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBefore(toDate, true);\n\n\t\t// When\n\t\tString actual = '' + matcher;\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('[on or before \"2019-01-01T12:00:00.000Z\"]', actual);\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBeforeWithNotInclusiveToStringReturnsExpectedString()\n\t{\n\t\t// Given\n\t\tDateTime toDate = DateTime.newInstanceGmt(2019, 1, 1, 12, 0, 0);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBefore(toDate, false);\n\n\t\t// When\n\t\tString actual = '' + matcher;\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('[before \"2019-01-01T12:00:00.000Z\"]', actual);\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeBetween_WithNullFromDatetime_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeBetween(null, true, System.now(), true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeBetween_WithNullToDatetime_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeBetween(System.now(), true, null, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeBetween_WithNullInclusiveFrom_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeBetween(System.now(), null, System.now(), true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDatetimeBetween_WithNullInclusiveTo_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DatetimeBetween(System.now(), true, System.now(), null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBetweenMatchesWithInclusiveFromWithoutInclusiveToShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBetween(NOW.addSeconds(-1), true, NOW.addSeconds(1), false);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(-2)));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(1)));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW.addSeconds(-1)));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW));\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBetweenMatchesWithInclusiveToWithoutInclusiveFromShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBetween(NOW.addSeconds(-1), false, NOW.addSeconds(1), true);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(2)));\n\t\tSystem.Assert.isFalse(matcher.matches(NOW.addSeconds(-1)));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW));\n\t\tSystem.Assert.isTrue(matcher.matches(NOW.addSeconds(1)));\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBetweenWithInclusiveToStringReturnsExpectedString()\n\t{\n\t\t// Given\n\t\tDateTime fromDate = DateTime.newInstanceGmt(2019, 1, 1, 12, 0, 0);\n\t\tDateTime toDate = DateTime.newInstanceGmt(2019, 1, 3, 12, 0, 0);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBetween(fromDate, true, toDate, true);\n\n\t\t// When\n\t\tString actual = '' + matcher;\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('[on or after \"2019-01-01T12:00:00.000Z\" and on or before \"2019-01-03T12:00:00.000Z\"]', actual);\n\t}\n\n\t@isTest\n\tprivate static void whenDatetimeBetweenWithNotInclusiveToStringReturnsExpectedString()\n\t{\n\t\t// Given\n\t\tDateTime fromDate = DateTime.newInstanceGmt(2019, 1, 1, 12, 0, 0);\n\t\tDateTime toDate = DateTime.newInstanceGmt(2019, 1, 3, 12, 0, 0);\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.DatetimeBetween(fromDate, false, toDate, false);\n\n\t\t// When\n\t\tString actual = '' + matcher;\n\n\t\t// Then\n\t\tSystem.Assert.areEqual('[after \"2019-01-01T12:00:00.000Z\" and before \"2019-01-03T12:00:00.000Z\"]', actual);\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalBetween_WithNullLower_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalBetween(null, true, 123, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalBetween_WithNullInclusiveLower_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalBetween(123, null, 123, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalBetween_WithNullUpper_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalBetween(123, true, null, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalBetween_WithNullInclusiveUpper_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalBetween(123, true, 123, null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenDecimalBetweenMatchesShouldReturnCorrectResults()\n\t{\n\t\tInteger lower = 5;\n\t\tInteger upper = 10;\n\n\t\tfflib_IMatcher exLowerExUpper = new fflib_MatcherDefinitions.DecimalBetween(lower, false, upper, false);\n\t\tfflib_IMatcher exLowerInUpper = new fflib_MatcherDefinitions.DecimalBetween(lower, false, upper, true);\n\t\tfflib_IMatcher inLowerExUpper = new fflib_MatcherDefinitions.DecimalBetween(lower, true, upper, false);\n\t\tfflib_IMatcher inLowerInUpper = new fflib_MatcherDefinitions.DecimalBetween(lower, true, upper, true);\n\n\t\t//Exclusive lower, exclusive upper\n\t\tSystem.Assert.isFalse(exLowerExUpper.matches(lower - 1));\n\t\tSystem.Assert.isFalse(exLowerExUpper.matches(lower));\n\t\tSystem.Assert.isTrue(exLowerExUpper.matches(lower + 1));\n\t\tSystem.Assert.isTrue(exLowerExUpper.matches(upper - 1));\n\t\tSystem.Assert.isFalse(exLowerExUpper.matches(upper));\n\t\tSystem.Assert.isFalse(exLowerExUpper.matches(upper + 1));\n\t\tSystem.Assert.isFalse(exLowerExUpper.matches(null));\n\t\tSystem.Assert.isFalse(exLowerExUpper.matches('NotADecimal'));\n\n\t\t//Exclusive lower, inclusive upper\n\t\tSystem.Assert.isFalse(exLowerInUpper.matches(lower - 1));\n\t\tSystem.Assert.isFalse(exLowerInUpper.matches(lower));\n\t\tSystem.Assert.isTrue(exLowerInUpper.matches(lower + 1));\n\t\tSystem.Assert.isTrue(exLowerInUpper.matches(upper - 1));\n\t\tSystem.Assert.isTrue(exLowerInUpper.matches(upper));\n\t\tSystem.Assert.isFalse(exLowerInUpper.matches(upper + 1));\n\t\tSystem.Assert.isFalse(exLowerInUpper.matches(null));\n\t\tSystem.Assert.isFalse(exLowerInUpper.matches('NotADecimal'));\n\t\t\n\t\t//Inclusive lower, exclusive upper\n\t\tSystem.Assert.isFalse(inLowerExUpper.matches(lower - 1));\n\t\tSystem.Assert.isTrue(inLowerExUpper.matches(lower));\n\t\tSystem.Assert.isTrue(inLowerExUpper.matches(lower + 1));\n\t\tSystem.Assert.isTrue(inLowerExUpper.matches(upper - 1));\n\t\tSystem.Assert.isFalse(inLowerExUpper.matches(upper));\n\t\tSystem.Assert.isFalse(inLowerExUpper.matches(upper + 1));\n\t\tSystem.Assert.isFalse(inLowerExUpper.matches(null));\n\t\tSystem.Assert.isFalse(inLowerExUpper.matches('NotADecimal'));\n\t\t\n\t\t//Inclusive lower, inclusive upper\n\t\tSystem.Assert.isFalse(inLowerInUpper.matches(lower - 1));\n\t\tSystem.Assert.isTrue(inLowerInUpper.matches(lower));\n\t\tSystem.Assert.isTrue(inLowerInUpper.matches(lower + 1));\n\t\tSystem.Assert.isTrue(inLowerInUpper.matches(upper - 1));\n\t\tSystem.Assert.isTrue(inLowerInUpper.matches(upper));\n\t\tSystem.Assert.isFalse(inLowerInUpper.matches(upper + 1));\n\t\tSystem.Assert.isFalse(inLowerInUpper.matches(null));\n\t\tSystem.Assert.isFalse(inLowerInUpper.matches('NotADecimal'));\n\t}\n\n\t@isTest\n\tprivate static void whenDecimalBetweenToStringReturnsExpectedString()\n\t{\n\t\tInteger lower = 5;\n\t\tInteger upper = 10;\n\n\t\tList<Integer> formatList = new List<Integer>{lower, upper};\n\n\t\tSystem.Assert.areEqual(String.format('greater than {0} and less than {1}', formatList),\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalBetween(lower, false, upper, false));\n\t\tSystem.Assert.areEqual(String.format('greater than {0} and less than or equal to {1}', formatList),\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalBetween(lower, false, upper, true));\n\t\tSystem.Assert.areEqual(String.format('greater than or equal to {0} and less than {1}', formatList),\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalBetween(lower, true, upper, false));\n\t\tSystem.Assert.areEqual(String.format('greater than or equal to {0} and less than or equal to {1}', formatList),\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalBetween(lower, true, upper, true));\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalLessThan_WithNullToMatch_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalLessThan(null, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalLessThan_WithNullInclusive_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalLessThan(123, null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenDecimalLessThanMatchesShouldReturnCorrectResults()\n\t{\n\t\tInteger toMatch = 5;\n\n\t\tfflib_IMatcher exclusive = new fflib_MatcherDefinitions.DecimalLessThan(toMatch, false);\n\t\tfflib_IMatcher inclusive = new fflib_MatcherDefinitions.DecimalLessThan(toMatch, true);\n\t\t\n\t\t//Exclusive\n\t\tSystem.Assert.isTrue(exclusive.matches(toMatch - 1));\n\t\tSystem.Assert.isFalse(exclusive.matches(toMatch));\n\t\tSystem.Assert.isFalse(exclusive.matches(toMatch + 1));\n\t\tSystem.Assert.isFalse(exclusive.matches(null));\n\t\tSystem.Assert.isFalse(exclusive.matches('NotADecimal'));\n\n\t\t//Inclusive\n\t\tSystem.Assert.isTrue(inclusive.matches(toMatch - 1));\n\t\tSystem.Assert.isTrue(inclusive.matches(toMatch));\n\t\tSystem.Assert.isFalse(inclusive.matches(toMatch + 1));\n\t\tSystem.Assert.isFalse(inclusive.matches(null));\n\t\tSystem.Assert.isFalse(inclusive.matches('NotADecimal'));\n\t}\n\n\t@isTest\n\tprivate static void whenDecimalLessThanToStringReturnsExpectedString()\n\t{\n\t\tInteger toMatch = 5;\n\n\t\tSystem.Assert.areEqual('[less than or equal to ' + toMatch + ']',\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalLessThan(toMatch, true));\n\t\tSystem.Assert.areEqual('[less than ' + toMatch + ']',\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalLessThan(toMatch, false));\n\t}\n\n\t@isTest\n\tprivate static void constructDecimalMoreThan_WithNullToMatch_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalMoreThan(null, true);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\t\t\n\t@isTest\n\tprivate static void constructDecimalMoreThan_WithNullInclusive_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.DecimalMoreThan(123, null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\t\t\n\t@isTest\n\tprivate static void whenDecimalMoreThanMatchesShouldReturnCorrectResults()\n\t{\n\t\tInteger toMatch = 5;\n\n\t\tfflib_IMatcher exclusive = new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, false);\n\t\tfflib_IMatcher inclusive = new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, true);\n\t\t\n\t\t//Exclusive\n\t\tSystem.Assert.isFalse(exclusive.matches(toMatch - 1));\n\t\tSystem.Assert.isFalse(exclusive.matches(toMatch));\n\t\tSystem.Assert.isTrue(exclusive.matches(toMatch + 1));\n\t\tSystem.Assert.isFalse(exclusive.matches(null));\n\t\tSystem.Assert.isFalse(exclusive.matches('NotADecimal'));\n\n\t\t//Inclusive\n\t\tSystem.Assert.isFalse(inclusive.matches(toMatch - 1));\n\t\tSystem.Assert.isTrue(inclusive.matches(toMatch));\n\t\tSystem.Assert.isTrue(inclusive.matches(toMatch + 1));\n\t\tSystem.Assert.isFalse(inclusive.matches(null));\n\t\tSystem.Assert.isFalse(inclusive.matches('NotADecimal'));\n\t}\n\n\t@isTest\n\tprivate static void whenDecimalMoreThanToStringReturnsExpectedString()\n\t{\n\t\tInteger toMatch = 5;\n\n\t\tSystem.Assert.areEqual('[greater than or equal to ' + toMatch + ']',\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, true));\n\t\tSystem.Assert.areEqual('[greater than ' + toMatch + ']',\n\t\t\t'' + new fflib_MatcherDefinitions.DecimalMoreThan(toMatch, false));\n\t}\n\n\t@isTest\n\tprivate static void constructFieldSetEquivalentTo_WithNullFieldSet_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.FieldSetEquivalentTo(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenFieldSetEquivalentToWithoutFieldSetShouldNeverMatch()\n\t{\n\t\t//Cheap test to maintain 100% code coverage, even in orgs without field sets defined.\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.FieldSetEquivalentTo();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t}\n\n\t@isTest\n\tprivate static void whenFieldSetEquivalentToMatchesShouldReturnCorrectResults()\n\t{\n\t\tSchema.FieldSet anyFieldSet = fflib_ApexMocksUtilsTest.findAnyFieldSet();\n\t\tif (anyFieldSet == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.FieldSetEquivalentTo(anyFieldSet);\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('hello'));\n\t\tSystem.Assert.isTrue(matcher.matches(anyFieldSet));\n\t}\n\n\t@isTest\n\tprivate static void whenFieldSetEquivalentToToStringReturnsExpectedString()\n\t{\n\t\tSchema.FieldSet anyFieldSet = fflib_ApexMocksUtilsTest.findAnyFieldSet();\n\t\tif (anyFieldSet == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tSet<Schema.FieldSetMember> fieldSetMembers = new Set<Schema.FieldSetMember>((anyFieldSet).getFields());\n\n\t\tSystem.Assert.areEqual('[FieldSet with fields ' + JSON.serialize(fieldSetMembers, false) + ']',\n\t\t\t'' + new fflib_MatcherDefinitions.FieldSetEquivalentTo(anyFieldSet));\n\t}\n\n\t@isTest\n\tprivate static void whenIsNullMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.IsNull();\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(null));\n\t}\n\n\t@isTest\n\tprivate static void whenIsNullToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[is null]', '' + new fflib_MatcherDefinitions.IsNull());\n\t}\n\n\t@isTest\n\tprivate static void whenIsNotNullMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.IsNotNull();\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t}\n\n\t@isTest\n\tprivate static void whenIsNotNullToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[is not null]', '' + new fflib_MatcherDefinitions.IsNotNull());\n\t}\n\n\t@isTest\n\tprivate static void whenListContainsMatchesShouldReturnCorrectResults()\n\t{\n\t\tList<String> names = new List<String>{ 'bob', 'tom', 'fred' };\n\t\tList<String> empty = new List<String>();\n\t\t\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.ListContains('fred').matches(null));\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.ListContains('fred').matches(empty));\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.ListContains('jack').matches(names));\n\t\tSystem.Assert.isTrue(new fflib_MatcherDefinitions.ListContains('fred').matches(names));\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.ListContains('fred').matches('NotAList'));\n\t}\n\n\t@isTest\n\tprivate static void whenListContainsToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[list containing \"hello\"]', '' + new fflib_MatcherDefinitions.ListContains('hello'));\n\t}\n\n\t@isTest\n\tprivate static void whenListIsEmptyMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.ListIsEmpty();\n\t\t\n\t\tList<String> names = new List<String>{ 'bob', 'tom', 'fred' };\n\t\tList<String> empty = new List<String>();\n\t\t\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(names));\n\t\tSystem.Assert.isTrue(matcher.matches(empty));\n\t\tSystem.Assert.isFalse(matcher.matches('NotAList'));\n\t}\n\n\t@isTest\n\tprivate static void whenListIsEmptyToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[empty list]', '' + new fflib_MatcherDefinitions.ListIsEmpty());\n\t}\n\n\t@isTest\n\tprivate static void constructSObjectOfType_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.SObjectOfType(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectOfTypeMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectOfType(ACCOUNT_OBJECT_TYPE);\n\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(OPPORTUNITY_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches('NotASObject'));\n\n\t\tSystem.Assert.isTrue(matcher.matches(ACCOUNT_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isTrue(matcher.matches(ACCOUNT_RECORD));\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectOfTypeToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[SObject of type Account]', '' + new fflib_MatcherDefinitions.SObjectOfType(ACCOUNT_OBJECT_TYPE));\n\t}\n\n\t@isTest\n\tprivate static void constructSObjectWith_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.SObjectWith(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null/empty: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructSObjectWith_WithEmptyArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.SObjectWith(new Map<Schema.SObjectField, Object>());\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null/empty: {}', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectWithMatchesShouldReturnCorrectResults()\n\t{\n\t\tMap<String, Schema.SObjectField> fields = ACCOUNT_OBJECT_TYPE.getDescribe().fields.getMap();\n\t\tSchema.SObjectField idField = fields.get('Id');\n\t\tSchema.SObjectField nameField = fields.get('Name');\n\t\tSchema.SObjectField createdDateField = fields.get('CreatedDate');\n\t\t\n\t\tMap<Schema.SObjectField, Object> queriedFieldValues = new Map<Schema.SObjectField, Object>\n\t\t{\n\t\t\tidField => ACCOUNT_RECORD.Id,\n\t\t\tnameField => ACCOUNT_RECORD.get('Name')\n\t\t};\n\n\t\tMap<Schema.SObjectField, Object> notQueriedFieldValues = new Map<Schema.SObjectField, Object>\n\t\t{\n\t\t\tcreatedDateField => System.now()\n\t\t};\n\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectWith(queriedFieldValues);\n\t\t\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(OPPORTUNITY_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches(ACCOUNT_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches('NotASObject'));\n\n\t\tSystem.Assert.isTrue(matcher.matches(ACCOUNT_RECORD));\n\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.SObjectWith(notQueriedFieldValues).matches(ACCOUNT_RECORD));\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectWithToStringReturnsExpectedString()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectWith(new Map<Schema.SObjectField, Object>{\n\t\t\tAccount.Name => 'Test'\n\t\t});\n\t\tSystem.Assert.areEqual('[SObject with fields {\"Name\":\"Test\"}]', '' + matcher);\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectsWithInOrderMatchesShouldReturnCorrectResults()\n\t{\n\t\tMap<String, Schema.SObjectField> fields = GROUP_OBJECT_TYPE.getDescribe().fields.getMap();\n\t\tSchema.SObjectField idField = fields.get('Id');\n\t\tSchema.SObjectField nameField = fields.get('Name');\n\t\tSchema.SObjectField createdDateField = fields.get('CreatedDate');\n\t\t\n\t\tlist<Map<Schema.SObjectField, Object>> queriedFieldValues = new list<Map<Schema.SObjectField, Object>>\n\t\t{\n            new map<Schema.SObjectField,Object> \n            {\n                idField => GROUP_RECORDS[0].Id,\n\t\t\t\tnameField => GROUP_RECORDS[0].get('Name')\n            },\n            new map<Schema.SObjectField,Object> \n            {\n                idField => GROUP_RECORDS[1].Id,\n\t\t\t\tnameField => GROUP_RECORDS[1].get('Name')\n            }               \n\t\t};\n\n\t\tlist<Map<Schema.SObjectField, Object>> failingFieldValues = new list<Map<Schema.SObjectField, Object>>\n\t\t{\n\t\t\tnew map<Schema.SObjectField,Object>\n\t\t\t{\n\t\t\t\tidField => GROUP_RECORDS[0].Id,\n\t\t\t\tnameField => GROUP_RECORDS[0].get('Name')\n\t\t\t},\n\t\t\tnew map<Schema.SObjectField,Object>\n\t\t\t{\n\t\t\t\tidField => GROUP_RECORDS[1].Id,\n\t\t\t\tnameField => GROUP_RECORDS[1].get('Name') + 'test'\n\t\t\t}\n\t\t};\n\n\t\tlist<Map<Schema.SObjectField, Object>> notQueriedFieldValues = new list<Map<Schema.SObjectField, Object>>\n\t\t{\n\t\t\tnew map<Schema.SObjectField,Object> \n            {\n                createdDateField => System.now()\n            },\n            new map<Schema.SObjectField,Object> \n            {\n                createdDateField => System.now()\n            }    \n\t\t};\n\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectsWith(queriedFieldValues);\n\t\t\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(new list<SObject>\n                                       {\n                                           OPPORTUNITY_OBJECT_TYPE.newSObject(),\n                                           OPPORTUNITY_OBJECT_TYPE.newSObject()    \n                                       }\n                                      ));\n\t\tSystem.Assert.isFalse(matcher.matches(new list<SObject>\n                                       {\n                                           GROUP_OBJECT_TYPE.newSObject(),\n                                           GROUP_OBJECT_TYPE.newSObject()\n                                       }\n                                      ),'sObjectsWith arity agrees but arg doesn\\'t');\n\t\tSystem.Assert.isFalse(matcher.matches('NotAListofSObject'));\n\n\t\tSystem.Assert.isTrue(matcher.matches(GROUP_RECORDS),'toMatch and args have same arity and in same order');\n        System.Assert.isTrue (!matcher.matches(new list<SObject> {GROUP_RECORDS[1],GROUP_RECORDS[0]}),\n                                     'sObjectsWith toMatch and args have same arity but args are in different order than toMatch') ;            \n                      \n\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.SObjectsWith(notQueriedFieldValues).matches(GROUP_RECORDS));\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.SObjectsWith(failingFieldValues).matches(GROUP_RECORDS));\n\t}\n\n    @isTest\n\tprivate static void whenSObjectsInAnyOrderWithMatchesShouldReturnCorrectResults()\n\t{\n\t\tMap<String, Schema.SObjectField> fields = GROUP_OBJECT_TYPE.getDescribe().fields.getMap();\n\t\tSchema.SObjectField idField = fields.get('Id');\n\t\tSchema.SObjectField nameField = fields.get('Name');\n\t\tSchema.SObjectField createdDateField = fields.get('CreatedDate');\n\t\t\n\t\tlist<Map<Schema.SObjectField, Object>> queriedFieldValues = new list<Map<Schema.SObjectField, Object>>\n\t\t{\n            new map<Schema.SObjectField,Object> \n            {\n                idField => GROUP_RECORDS[0].Id,\n\t\t\t\tnameField => GROUP_RECORDS[0].get('Name')\n            },\n            new map<Schema.SObjectField,Object> \n            {\n                idField => GROUP_RECORDS[1].Id,\n\t\t\t\tnameField => GROUP_RECORDS[1].get('Name')\n            }               \n\t\t};\n\n\t\tlist<Map<Schema.SObjectField, Object>> notQueriedFieldValues = new list<Map<Schema.SObjectField, Object>>\n\t\t{\n\t\t\tnew map<Schema.SObjectField,Object> \n            {\n                createdDateField => System.now()\n            },\n            new map<Schema.SObjectField,Object> \n            {\n                createdDateField => System.now()\n            }    \n\t\t};\n\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectsWith(queriedFieldValues,false); // any order\n\t\t\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(new list<SObject>\n                                       {\n                                           OPPORTUNITY_OBJECT_TYPE.newSObject(),\n                                           OPPORTUNITY_OBJECT_TYPE.newSObject()    \n                                       }\n                                      ));\n\t\tSystem.Assert.isFalse(matcher.matches(new list<SObject>\n                                       {\n                                           GROUP_OBJECT_TYPE.newSObject(),\n                                           GROUP_OBJECT_TYPE.newSObject()\n                                       }\n                                      ),'sObjectsWith arity agrees but arg doesn\\'t match matcher');\n\t\tSystem.Assert.isFalse(matcher.matches('NotAListofSObject'));\n\n\t\tSystem.Assert.isTrue(matcher.matches(GROUP_RECORDS),'toMatch and args have same arity and in same order. Match should be OK');\n        System.Assert.isTrue (matcher.matches(new list<SObject> {GROUP_RECORDS[1],GROUP_RECORDS[0]}),\n                                     'sObjectsWith toMatch and args have same arity but args are in diff order than matcher. Should be OK') ;            \n                      \n\n\t\tSystem.Assert.isFalse(new fflib_MatcherDefinitions.SObjectsWith(notQueriedFieldValues,false).matches(GROUP_RECORDS));\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectsWithToStringReturnsExpectedString()\n\t{\n\t\tList<Map<Schema.SObjectField, Object>> toMatch = new List<Map<Schema.SObjectField, Object>>{\n\t\t\tnew Map<Schema.SObjectField, Object> {\n\t\t\t\tAccount.Name => 'Test'\n\t\t\t}\n\t\t};\n\n\t\tSystem.Assert.areEqual('[ordered SObjects with [{\"Name\":\"Test\"}]]', '' + new fflib_MatcherDefinitions.SObjectsWith(toMatch, true));\n\t\tSystem.Assert.areEqual('[unordered SObjects with [{\"Name\":\"Test\"}]]', '' + new fflib_MatcherDefinitions.SObjectsWith(toMatch, false));\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectsWithDifferentArityMatchesShouldReturnFalse()\n\t{\n\t\tList<Map<Schema.SObjectField, Object>> toMatch = new List<Map<Schema.SObjectField, Object>>{\n\t\t\tnew Map<Schema.SObjectField, Object> {\n\t\t\t\tAccount.Name => 'Test'\n\t\t\t}\n\t\t};\n\t\tBoolean matchResult = new fflib_MatcherDefinitions.SObjectsWith(toMatch).matches(new List<SObject>{});\n\t\tSystem.Assert.areEqual(matchResult, false);\n\t}\n\n\t@isTest\n\tprivate static void constructSObjectsWith_WithNullArg_ThrowsException()\n\t{\n\t\ttry {\n\t\t\tnew fflib_MatcherDefinitions.SObjectsWith(null);\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null/empty/other than list of map<Schema.SobjectField,Object>: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void constructSObjectWithId_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.SObjectWithId(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectWithIdMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectWithId(ACCOUNT_RECORD.Id);\n\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(OPPORTUNITY_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches(ACCOUNT_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches('NotASObject'));\n\n\t\tSystem.Assert.isTrue(matcher.matches(ACCOUNT_RECORD));\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectWithIdToStringReturnsExpectedString()\n\t{\n\t\tId recordId = '001000000000001AAA';\n\t\tSystem.Assert.areEqual('[SObject with Id \"001000000000001AAA\"]', '' + new fflib_MatcherDefinitions.SObjectWithId(recordId));\n\t}\n\n\t@isTest\n\tprivate static void constructSObjectWithName_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.SObjectWithName(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectWithNameMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.SObjectWithName((String)ACCOUNT_RECORD.get('Name'));\n\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(OPPORTUNITY_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches(ACCOUNT_OBJECT_TYPE.newSObject()));\n\t\tSystem.Assert.isFalse(matcher.matches('NotASObject'));\n\n\t\tSystem.Assert.isTrue(matcher.matches(ACCOUNT_RECORD));\n\t}\n\n\t@isTest\n\tprivate static void whenSObjectWithNameToStringReturnsExpectedString()\n\t{\n\t\tSystem.Assert.areEqual('[SObject with Name \"Test\"]', '' + new fflib_MatcherDefinitions.SObjectWithName('Test'));\n\t}\n\n\t@isTest\n\tprivate static void whenStringContainsMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.StringContains('bob');\n\t\tSystem.Assert.isFalse(matcher.matches(7));\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(''));\n\t\tSystem.Assert.isFalse(matcher.matches('blob'));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches('bobby'));\n\t}\n\n\t@isTest\n\tprivate static void constructStringContains_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.StringContains(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenStringContainsToStringReturnsExpectedStrings()\n\t{\n\t\tSystem.Assert.areEqual('[contains \"hello\"]', '' + new fflib_MatcherDefinitions.StringContains('hello'));\n\t}\n\n\t@isTest\n\tprivate static void whenStringEndsWithMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.StringEndsWith('bob');\n\t\tSystem.Assert.isFalse(matcher.matches(7));\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(''));\n\t\tSystem.Assert.isFalse(matcher.matches('bobby'));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches('jimbob'));\n\t}\n\n\t@isTest\n\tprivate static void constructStringEndsWith_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.StringEndsWith(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenStringEndsWithToStringReturnsExpectedStrings()\n\t{\n\t\tSystem.Assert.areEqual('[ends with \"hello\"]', '' + new fflib_MatcherDefinitions.StringEndsWith('hello'));\n\t}\n\n\t@isTest\n\tprivate static void whenIsBlankWithMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.StringIsBlank();\n\t\tSystem.Assert.isFalse(matcher.matches(7));\n\t\tSystem.Assert.isFalse(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches(null));\n\t\tSystem.Assert.isTrue(matcher.matches(''));\n\t}\n\n\t@isTest\n\tprivate static void whenStringIsBlankToStringReturnsExpectedStrings()\n\t{\n\t\tSystem.Assert.areEqual('[blank String]', '' + new fflib_MatcherDefinitions.StringIsBlank());\n\t}\n\n\t@isTest\n\tprivate static void whenIsNotBlankWithMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.StringIsNotBlank();\n\t\tSystem.Assert.isFalse(matcher.matches(7));\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(''));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t}\n\n\t@isTest\n\tprivate static void whenStringIsNotBlankToStringReturnsExpectedStrings()\n\t{\n\t\tSystem.Assert.areEqual('[non-blank String]', '' + new fflib_MatcherDefinitions.StringIsNotBlank());\n\t}\n\n\t@isTest\n\tprivate static void whenStringMatchesMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.StringMatches('(b|m)o[a-z]*');\n\t\tSystem.Assert.isFalse(matcher.matches(7));\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches('bib'));\n\t\tSystem.Assert.isFalse(matcher.matches('jimbob'));\n\t\tSystem.Assert.isFalse(matcher.matches('tom'));\n\t\tSystem.Assert.isFalse(matcher.matches('bob1'));\n\t\tSystem.Assert.isTrue(matcher.matches('bobby'));\n\t\tSystem.Assert.isTrue(matcher.matches('mo'));\n\t}\n\n\t@isTest\n\tprivate static void whenStringMatchesToStringReturnsExpectedStrings()\n\t{\n\t\tSystem.Assert.areEqual('[matches regex \"hello\"]', '' + new fflib_MatcherDefinitions.StringMatches('hello'));\n\t}\n\n\t@isTest\n\tprivate static void constructStringMatches_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.StringMatches(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenStringStartsWithMatchesShouldReturnCorrectResults()\n\t{\n\t\tfflib_IMatcher matcher = new fflib_MatcherDefinitions.StringStartsWith('bob');\n\t\tSystem.Assert.isFalse(matcher.matches(7));\n\t\tSystem.Assert.isFalse(matcher.matches(null));\n\t\tSystem.Assert.isFalse(matcher.matches(''));\n\t\tSystem.Assert.isFalse(matcher.matches('jimbob'));\n\t\tSystem.Assert.isTrue(matcher.matches('bob'));\n\t\tSystem.Assert.isTrue(matcher.matches('bobby'));\n\t}\n\n\t@isTest\n\tprivate static void whenStringStartsWithToStringReturnsExpectedStrings()\n\t{\n\t\tSystem.Assert.areEqual('[starts with \"hello\"]', '' + new fflib_MatcherDefinitions.StringStartsWith('hello'));\n\t}\n\n\t@isTest\n\tprivate static void constructStringStartsWith_WithNullArg_ThrowsException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew fflib_MatcherDefinitions.StringStartsWith(null);\t\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('Arg cannot be null: null', e.getMessage());\n\t\t}\n\t}\n\n\t@isTest\n\tprivate static void whenJSONExceptionOccursStringifyShouldReturnsObjectToString()\n\t{\n\t\t// SObjectField object definitely can't be serialized by JSON.serialize() method\n\t\tSchema.SObjectField sObjField = Account.Description;\n\t\tSystem.Assert.areEqual('' + sObjField, fflib_MatcherDefinitions.stringify(sObjField));\n\t}\n\n\tprivate class StringMatcher implements fflib_IMatcher\n\t{\n\t\tprivate final String value;\n\n\t\tpublic StringMatcher(String value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic Boolean matches(Object arg)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override String toString()\n\t\t{\n\t\t\treturn '\"' + value + '\"';\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MatcherDefinitionsTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MethodArgValuesTest.cls",
    "content": "/**\n * Copyright (c) 2014-2016, FinancialForce.com, inc\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *      this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *      this list of conditions and the following disclaimer in the documentation\n *      and/or other materials provided with the distribution.\n * - Neither the name of the FinancialForce.com, inc nor the names of its contributors\n *      may be used to endorse or promote products derived from this software without\n *      specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n@isTest\npublic with sharing class fflib_MethodArgValuesTest\n{\n\t@isTest\n\tprivate static void equalsReturnsExpectedResults()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues qm1 = new fflib_MethodArgValues(new List<Object>{ 'hello' });\n\t\tfflib_MethodArgValues qm2 = new fflib_MethodArgValues(new List<Object>{ 'hello' });\n\t\tfflib_MethodArgValues qm3 = new fflib_MethodArgValues(new List<Object>{ 'hi' });\n\t\tfflib_MethodArgValues qm4 = new fflib_MethodArgValues(new List<Object>{ 'hello', 'hello', 'hello' });\n\t\tfflib_MethodArgValues qm5 = new fflib_MethodArgValues(new List<Object>());\n\t\tfflib_MethodArgValues qm6 = new fflib_MethodArgValues(null);\n\n\t\t//When/thens\n\t\tSystem.Assert.areEqual(qm1, qm1);\n\t\tSystem.Assert.areEqual(qm1, qm2);\n\t\tSystem.Assert.areNotEqual(qm1, qm3);\n\t\tSystem.Assert.areNotEqual(qm1, qm4);\n\t\tSystem.Assert.areNotEqual(qm1, qm5);\n\t\tSystem.Assert.areNotEqual(qm1, qm6);\n\n\t\tSystem.Assert.areEqual(qm2, qm2);\n\t\tSystem.Assert.areNotEqual(qm2, qm3);\n\t\tSystem.Assert.areNotEqual(qm2, qm4);\n\t\tSystem.Assert.areNotEqual(qm2, qm5);\n\t\tSystem.Assert.areNotEqual(qm2, qm6);\n\n\t\tSystem.Assert.areEqual(qm3, qm3);\n\t\tSystem.Assert.areNotEqual(qm3, qm4);\n\t\tSystem.Assert.areNotEqual(qm3, qm5);\n\t\tSystem.Assert.areNotEqual(qm3, qm6);\n\n\t\tSystem.Assert.areEqual(qm4, qm4);\n\t\tSystem.Assert.areNotEqual(qm4, qm5);\n\t\tSystem.Assert.areNotEqual(qm4, qm6);\n\n\t\tSystem.Assert.areEqual(qm5, qm5);\n\t\tSystem.Assert.areNotEqual(qm5, qm6);\n\n\t\tSystem.Assert.areEqual(qm6, qm6);\n\t}\n\n\t@isTest\n\tprivate static void hashCodeReturnsExpectedResults()\n\t{\n\t\t//Given\n\t\tfflib_MethodArgValues qm1 = new fflib_MethodArgValues(new List<Object>{ 'hello' });\n\t\tfflib_MethodArgValues qm2 = new fflib_MethodArgValues(new List<Object>{ 'hello' });\n\t\tfflib_MethodArgValues qm3 = new fflib_MethodArgValues(new List<Object>{ 'hi' });\n\t\tfflib_MethodArgValues qm4 = new fflib_MethodArgValues(new List<Object>{ 'hello', 'hello', 'hello' });\n\t\tfflib_MethodArgValues qm5 = new fflib_MethodArgValues(new List<Object>());\n\t\tfflib_MethodArgValues qm6 = new fflib_MethodArgValues(null);\n\n\t\t//When/thens\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm1.hashCode());\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm2.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm2.hashCode(), qm2.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm3.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm4.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm4.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm4.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm5.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm5.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm6.hashCode(), qm6.hashCode());\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MethodArgValuesTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MyList.cls",
    "content": "/*\n Copyright (c) 2014-2017 FinancialForce.com, inc.  All rights reserved.\n */\n\n/**\n * @nodoc\n */\n@isTest\npublic with sharing class fflib_MyList implements IList\n{\n\tpublic interface IList\n\t{\n\t\tvoid add(String value);\n\t\tvoid add(String value1, String value2, String value3, String value4);\n\t\tvoid addMore(String value);\n\t\tvoid add(String[] value); // Test methods with the same name and number of params\n\t\tString get(Integer index);\n\t\tString get2(Integer index, String value); // This is just a method signature to allow me to test stubbing a method with multiple arguments\n\t\tvoid clear();\n\t\tBoolean isEmpty();\n\t\tvoid set(Integer index, Object value);\n\t}\n\n\tpublic void add(String[] value)\n\t{\n\t}\n\n\tpublic void add(String value)\n\t{\n\t}\n\n\tpublic void add(String value1, String value2, String value3, String value4)\n\t{\n\t}\n\n\tpublic void addMore(String value)\n\t{\n\t}\n\n\tpublic String get(Integer index)\n\t{\n\t\treturn 'fred';\n\t}\n\n\tpublic void clear()\n\t{\n\t}\n\n\tpublic Boolean isEmpty()\n\t{\n\t\treturn true;\n\t}\n\n\tpublic void set(Integer index, Object value)\n\t{\n\t}\n\n\tpublic String get2(Integer index, String value)\n\t{\n\t\treturn 'mary';\n\t}\n\n\tpublic static String getStubClassName()\n\t{\n\t\treturn fflib_ApexMocks.extractTypeName(new fflib_ApexMocks().mock(fflib_MyList.class));\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_MyList.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_QualifiedMethodAndArgValuesTest.cls",
    "content": "@isTest\npublic class fflib_QualifiedMethodAndArgValuesTest\n{\n    @isTest\n    private static void equalsReturnsExpectedResults()\n    {\n        fflib_QualifiedMethod qm1 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n        fflib_MethodArgValues mav1 = new fflib_MethodArgValues(new List<Object>{ 'hello' });\n        Object obj1 = 'hello';\n\n        fflib_QualifiedMethodAndArgValues qmaav = new fflib_QualifiedMethodAndArgValues(qm1, mav1, obj1);\n\n        fflib_QualifiedMethod qm2 = qmaav.getQualifiedMethod();\n        fflib_MethodArgValues mav2 = qmaav.getMethodArgValues();\n        Object obj2 = qmaav.getMockInstance();\n        String string1 = qmaav.toString();\n\n        System.Assert.areEqual(qm1, qm2);\n        System.Assert.areEqual(mav1, mav2);\n        System.Assert.areEqual(obj1, obj2);\n        System.Assert.areEqual('Type1.Method1(Integer) with args: [hello]', string1);\n\n    }\n}\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_QualifiedMethodAndArgValuesTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_QualifiedMethodTest.cls",
    "content": "/*\n * Copyright (c) 2016-2017 FinancialForce.com, inc.  All rights reserved.\n */\n@isTest\npublic with sharing class fflib_QualifiedMethodTest\n{\n\t@isTest\n\tprivate static void equalsReturnsExpectedResults()\n\t{\n\t\t//Given\n\t\tfflib_QualifiedMethod qm1 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n\t\tfflib_QualifiedMethod qm2 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n\t\tfflib_QualifiedMethod qm3 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ String.class } );\n\t\tfflib_QualifiedMethod qm4 = new fflib_QualifiedMethod('Type2', 'Method2', new List<Type>{ Integer.class, String.class, fflib_QualifiedMethodTest.class } );\n\t\tfflib_QualifiedMethod qm5 = new fflib_QualifiedMethod('', '', new List<Type>{} );\n\t\tfflib_QualifiedMethod qm6 = new fflib_QualifiedMethod(null, null, null );\n\n\t\t//When/thens\n\t\tSystem.Assert.areEqual(qm1, qm1);\n\t\tSystem.Assert.areEqual(qm1, qm2);\n\t\tSystem.Assert.areNotEqual(qm1, qm3);\n\t\tSystem.Assert.areNotEqual(qm1, qm4);\n\t\tSystem.Assert.areNotEqual(qm1, qm5);\n\t\tSystem.Assert.areNotEqual(qm1, qm6);\n\n\t\tSystem.Assert.areEqual(qm2, qm2);\n\t\tSystem.Assert.areNotEqual(qm2, qm3);\n\t\tSystem.Assert.areNotEqual(qm2, qm4);\n\t\tSystem.Assert.areNotEqual(qm2, qm5);\n\t\tSystem.Assert.areNotEqual(qm2, qm6);\n\n\t\tSystem.Assert.areEqual(qm3, qm3);\n\t\tSystem.Assert.areNotEqual(qm3, qm4);\n\t\tSystem.Assert.areNotEqual(qm3, qm5);\n\t\tSystem.Assert.areNotEqual(qm3, qm6);\n\n\t\tSystem.Assert.areEqual(qm4, qm4);\n\t\tSystem.Assert.areNotEqual(qm4, qm5);\n\t\tSystem.Assert.areNotEqual(qm4, qm6);\n\n\t\tSystem.Assert.areEqual(qm5, qm5);\n\t\tSystem.Assert.areNotEqual(qm5, qm6);\n\n\t\tSystem.Assert.areEqual(qm6, qm6);\n\t}\n\n\t@isTest\n\tprivate static void hashCodeReturnsExpectedResults()\n\t{\n\t\t//Given\n\t\tfflib_QualifiedMethod qm1 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n\t\tfflib_QualifiedMethod qm2 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n\t\tfflib_QualifiedMethod qm3 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ String.class } );\n\t\tfflib_QualifiedMethod qm4 = new fflib_QualifiedMethod('Type2', 'Method2', new List<Type>{ Integer.class, String.class, fflib_QualifiedMethodTest.class } );\n\t\tfflib_QualifiedMethod qm5 = new fflib_QualifiedMethod('', '', new List<Type>{} );\n\t\tfflib_QualifiedMethod qm6 = new fflib_QualifiedMethod(null, null, null );\n\n\t\t//When/thens\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm1.hashCode());\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm2.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm2.hashCode(), qm2.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm3.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm4.hashCode(), qm4.hashCode());\n\t\tSystem.Assert.areNotEqual(qm4.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm4.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm5.hashCode(), qm5.hashCode());\n\t\tSystem.Assert.areNotEqual(qm5.hashCode(), qm6.hashCode());\n\n\t\tSystem.Assert.areEqual(qm6.hashCode(), qm6.hashCode());\n\t}\n\n\t@isTest\n\tpublic static void toStringReturnsExpectedResult()\n\t{\n\t\tSystem.Assert.areEqual('MyClass.MyMethod(Integer)', new fflib_QualifiedMethod('MyClass', 'MyMethod', new List<Type>{ Integer.class }).toString());\n\t}\n\n\t@isTest\n\tprivate static void equalsReturnsExpectedResultsForHasDependentMocks()\n\t{\n\t\t//Given\n\t\tString instance = 'My object instance';\n\t\tString instance2 = 'My other object instance';\n\t\tfflib_QualifiedMethod qm1 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n\t\tfflib_QualifiedMethod qm2 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class }, instance);\n\t\tfflib_QualifiedMethod qm3 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class }, instance);\n\t\tfflib_QualifiedMethod qm4 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class }, instance2);\n\n\t\t//When/thens\n\t\tfflib_ApexMocksConfig.HasIndependentMocks = false;\n\t\t\n\t\tSystem.Assert.areEqual(qm1, qm2);\n\t\tSystem.Assert.areEqual(qm1, qm3);\n\t\tSystem.Assert.areEqual(qm1, qm4);\n\n\t\tfflib_ApexMocksConfig.HasIndependentMocks = true;\n\n\t\tSystem.Assert.areNotEqual(qm1, qm2);\n\t\tSystem.Assert.areNotEqual(qm1, qm3);\n\t\tSystem.Assert.areNotEqual(qm1, qm4);\n\n\t\tSystem.Assert.areEqual(qm2, qm3);\n\t\tSystem.Assert.areNotEqual(qm2, qm4);\n\n\t\tSystem.Assert.areNotEqual(qm3, qm4);\n\t}\n\n\t@isTest\n\tprivate static void hashCodeReturnsExpectedResultsForHasDependentMocks()\n\t{\n\t\t//Given\n\t\tString instance = 'My object instance';\n\t\tString instance2 = 'My other object instance';\n\t\tfflib_QualifiedMethod qm1 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class } );\n\t\tfflib_QualifiedMethod qm2 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class }, instance);\n\t\tfflib_QualifiedMethod qm3 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class }, instance);\n\t\tfflib_QualifiedMethod qm4 = new fflib_QualifiedMethod('Type1', 'Method1', new List<Type>{ Integer.class }, instance2);\n\n\t\t//When/thens\n\t\tfflib_ApexMocksConfig.HasIndependentMocks = false;\n\t\t\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm2.hashCode());\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areEqual(qm1.hashCode(), qm4.hashCode());\n\n\t\tfflib_ApexMocksConfig.HasIndependentMocks = true;\n\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm2.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm1.hashCode(), qm4.hashCode());\n\n\t\tSystem.Assert.areEqual(qm2.hashCode(), qm3.hashCode());\n\t\tSystem.Assert.areNotEqual(qm2.hashCode(), qm4.hashCode());\n\n\t\tSystem.Assert.areNotEqual(qm3.hashCode(), qm4.hashCode());\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_QualifiedMethodTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n\t<apiVersion>63.0</apiVersion>\n</ApexClass>\n"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_SystemTest.cls",
    "content": "/*\n * Copyright (c) 2017 FinancialForce.com, inc.  All rights reserved.\n */\n@IsTest\nprivate class fflib_SystemTest\n{\n\t@IsTest\n\tprivate static void assertEquals_WithNoMatchers_ShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_System.assertEquals('Test String', 'Test String');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('fflib_System.assertEquals expects you to register exactly 1 fflib_IMatcher (typically through the helpers in fflib_Match).', e.getMessage());\n\t\t}\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithTooManyMatchers_ShouldThrowException()\n\t{\n\t\t//Register matchers prematurely\n\t\tfflib_Match.stringStartsWith('Test S');\n\t\tfflib_Match.stringEndsWith('t String');\n\t\tfflib_Match.stringIsNotBlank();\n\n\t\ttry\n\t\t{\n\t\t\tfflib_System.assertEquals(fflib_Match.stringStartsWith('Test S'), 'Test String');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('fflib_System.assertEquals expects you to register exactly 1 fflib_IMatcher (typically through the helpers in fflib_Match).', e.getMessage());\n\t\t}\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithMismatch_ShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_System.assertEquals(fflib_Match.stringStartsWith('Test X'), 'Test String');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tString expected = 'Actual: Test String';\n\t\t\tString actual = e.getMessage();\n\t\t\tSystem.Assert.isTrue(actual.contains(expected), 'Expected: ' + expected + ', Actual: ' + actual);\n\t\t}\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithMatch_ShouldPass()\n\t{\n\t\tfflib_System.assertEquals(fflib_Match.stringStartsWith('Test S'), 'Test String');\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithCombinedMatcher_ShouldPass()\n\t{\n\t\tfflib_System.assertEquals(fflib_Match.allOf(\n\t\t\t\tfflib_Match.stringStartsWith('Test S'),\n\t\t\t\tfflib_Match.stringEndsWith('t String'),\n\t\t\t\tfflib_Match.stringIsNotBlank())\n\t\t\t, 'Test String');\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithCustomMessage_WithNoMatchers_ShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_System.assertEquals('Test String', 'Test String', 'My Custom Message');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('fflib_System.assertEquals expects you to register exactly 1 fflib_IMatcher (typically through the helpers in fflib_Match).', e.getMessage());\n\t\t}\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithCustomMessage_WithTooManyMatchers_ShouldThrowException()\n\t{\n\t\t//Register matchers prematurely\n\t\tfflib_Match.stringStartsWith('Test S');\n\t\tfflib_Match.stringEndsWith('t String');\n\t\tfflib_Match.stringIsNotBlank();\n\n\t\ttry\n\t\t{\n\t\t\tfflib_System.assertEquals(fflib_Match.stringStartsWith('Test S'), 'Test String', 'My Custom Message');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tSystem.Assert.areEqual('fflib_System.assertEquals expects you to register exactly 1 fflib_IMatcher (typically through the helpers in fflib_Match).', e.getMessage());\n\t\t}\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithCustomMessage_WithMismatch_ShouldThrowException()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfflib_System.assertEquals(fflib_Match.stringStartsWith('Test X'), 'Test String', 'My Custom Message');\n\t\t\tSystem.Assert.fail('Expected exception');\n\t\t}\n\t\tcatch (fflib_ApexMocks.ApexMocksException e)\n\t\t{\n\t\t\tString expected = 'Actual: Test String -- My Custom Message';\n\t\t\tString actual = e.getMessage();\n\t\t\tSystem.Assert.isTrue(actual.contains(expected), 'Expected: ' + expected + ', Actual: ' + actual);\n\t\t}\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithCustomMessage_WithMatch_ShouldPass()\n\t{\n\t\tfflib_System.assertEquals(fflib_Match.stringStartsWith('Test S'), 'Test String', 'My Custom Message');\n\t}\n\n\t@IsTest\n\tprivate static void assertEquals_WithCustomMessage_WithCombinedMatcher_ShouldPass()\n\t{\n\t\tfflib_System.assertEquals(fflib_Match.allOf(\n\t\t\t\tfflib_Match.stringStartsWith('Test S'),\n\t\t\t\tfflib_Match.stringEndsWith('t String'),\n\t\t\t\tfflib_Match.stringIsNotBlank())\n\t\t\t, 'Test String', 'My Custom Message');\n\t}\n}"
  },
  {
    "path": "sfdx-source/apex-mocks/test/classes/fflib_SystemTest.cls-meta.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n    <apiVersion>63.0</apiVersion>\n    <status>Active</status>\n</ApexClass>\n"
  }
]