Question: Simple use case for ApexMocks of a Service layer class, something I've done a 100 times

```
fflib_ApexMocks mocks = new fflib_ApexMocks();

OpportunitiesServiceImpl mockOpportunitiesService = (OpportunitiesServiceImpl) mocks.mock(OpportunitiesServiceImpl.class);

```

At runtime, I get this error:

```
Class.System.Test.createStub: line 93, column 1
Class.fflib_ApexMocks.mock: line 67, column 1
Class.MyTest.myTestMethod: line 28, column 1
System.TypeException: @Override specified for non-overriding method: 
  String OpportunitiesServiceImpl__sfdc_ApexStub.someMethod(Id)

```

The `OpportunitiesServiceImpl` class looks like this:

```
public virtual with sharing class OpportunitiesServiceImpl implements IOpportunitiesService {

  public virtual void method1() {..}
  public virtual void method2() {..}
  private Id doStuff();
  Id someMethod(Id oppoId);
  public class SomeInner{..}
  public virtual void method3() {..} 
}

```

Answer: 
Note the following:

* `OpportunitiesServiceImpl` is at V48.0
* `fflib_ApexMocks` is at V39 (this issues the call to `System.Test.createStub`)

So, I can't explain why this fixes the issue but it does:

The offending method indicated in the error message does not have an annotation of either `public` or `private`. Adding `private` and rerunning eliminates the error

```
public virtual with sharing class OpportunitiesServiceImpl implements IOpportunitiesService {

  public virtual void method1() {..}
  public virtual void method2() {..}
  private Id doStuff();
  private Id someMethod(Id oppoId);  // added the access modifier "private"
  public class SomeInner{..}
  public virtual void method3() {..} 
}

```

*Note that helper methods used by your mocked method must have an access modifier*
If you are trying to mock a method within a class, like calling some mock for `someMethod` instead of actual method `someMethod` in `OpportunitiesServiceImpl` implementation

```
OpportunitiesServiceImpl mockOpportunitiesService = (OpportunitiesServiceImpl) mocks.mock(OpportunitiesServiceImpl.class);
mockOpportunitiesService.someMethod('005000111222333');

```

you have to make that method public

```
public virtual with sharing class OpportunitiesServiceImpl implements IOpportunitiesService {

  public virtual void method1() {..}
  public virtual void method2() {..}
  private Id doStuff();
  public Id someMethod(Id oppoId);  // added the access modifier "private"
  public class SomeInner{..}
  public virtual void method3() {..} 
}

```

If this method lacks either annotation, then exception `System.TypeException: @Override specified for non-overriding method:`  will be raised.

If this method has `private` annotation, the method will not be mocked, but the actual method from `OpportunitiesServiceImpl` will be called.

So to mock the method, it should have `public` or `global` annotation, in this case the mock will be called instead of the actual method from the underlying class.