We are generating mocks for interfaces which come from different libraries but have the same package name. The uniqueness of package names is provided by adding a counter to the package names. However, the order in which these names are generated is not deterministic (the code iterate the keys of a map which does not guarantee any order).
For example, two consecutive pegomock generation runs results in the following import statement section for our MockFactory :
We are generating mocks for interfaces which come from different libraries but have the same package name. The uniqueness of package names is provided by adding a counter to the package names. However, the order in which these names are generated is not deterministic (the code iterate the keys of a map which does not guarantee any order).
For example, two consecutive pegomock generation runs results in the following import statement section for our MockFactory :
Only the aliases have changed.
To prevent this problem, I recommend sorting the importPath before iterating them.