added tests and documentation for InversionsCounter class