Description
The PoissonSamplerCache method:
public DiscreteSampler createPoissonSampler( UniformRandomProvider rng, double mean) {
Can now be:
public SharedStateDiscreteSampler createPoissonSampler( UniformRandomProvider rng, double mean) {
This works with no other code changes but breaks binary compatibility as the return type, although a sub-interface, is different.
The solution is to create a new method:
public SharedStateDiscreteSampler createSharedStateSampler( UniformRandomProvider rng, double mean) {
And deprecate the old method in favour of the new one.
An alternative is to add javadoc to the current method stating that a cast to SharedStateDiscreteSampler is supported. This would have to be checked by a unit test.