Currently, the Log class (org.apache.mesos.Log) in the Java API has a static initializer that calls MesosNativeLibrary.load(). This static initialization causes issues when mocking this class.
Per JLS, using the Class name shouldn't trigger the static initialization. However, the ClassProxy in EasyMock performs some reflection tricks which trigger the static initializer. Since the static initializer needs a native library which would be otherwise be linked dynamically in it's path, it makes our unit tests flaky.
After considering a few possibilities, the cleanest solution seems to be
(a) Make org.apache.mesos.Log an interface so users using the Java-API can mock the interface. or
(b) Add a new interface that org.apache.mesos.Log implements, which the clients can use for mocking.