Question: I want to execute a Java class to test pieces of an Android application's functionality (from a Java Module) to read/write data to file. If I execute within the Android module, I get Stub! errors (Android SDK). If I install or emulate, it is very slow (I'm only testing a specific piece).

If I include the Android module as a Module Dependency, IntelliJ still builds the Android files and I get a Stub! error during execution. But if I only include the classes directory and mark them as Provided, I get errors when Log. is called.

Is there a way to run simple Java tests on components of an Android application (not using Activity, etc), using the Java SDK and not building Android specific files?

Answer: 
Seems to be fixed in later releases of IntelliJ 10 - hadn't been able to reproduce the issue
While you can use Robolectric or other techniques to tests on the host JVM, it's worth noticing that this should only be used as a workaround during the development cycle to avoid long waits for the tests to run on the emulator or device and would never replace testing on the real platform as incompatibilities between **Dalvik** and **JavaSE** runtime may affect the accuracy of the tests.

Latest devices, introducing more powerful CPUs, can run the tests at a very reasonable speed in most of the cases, so probably there's no need to hunt for other solutions.