Sure. Just look through the testsuite in the JBoss Cache source. Most of the unit tests involve programatically creating standalone JBoss Cache instances and having them form clusters. The different instances are started in the same JVM, but that's not important. They still communicate with each other via the machine's network layer.