First, to provide clarity notice in the code below that there are three different variables. The first is a java.util.ArrayList, the second is a Java array and the third is a JavaScript array.
var ArrayList = java.util.ArrayList;
var Arrays = java.util.Arrays;
var javaArrayList = new ArrayList();
javaArrayList.add('This');
javaArrayList.add('is');
javaArrayList.add('a');
javaArrayList.add('Java');
javaArrayList.add('ArrayList');
var testMessage = qie.parseHL7String('MSH||\nRWC|1|text\nRWC|2|to\nRWC|3|test');
var javaArray = testMessage.getAllNodes('RWC-2'); //getAllNodes returns a Java String array (String[]).
var javasciptArray = ['123', '456', '951', 'Fish', 'Goat', 'Possum'];
qie.debug('The variable javaArrayList contains: ' + javaArrayList);
qie.debug('The variable javaArray contains: ' + Arrays.toString(javaArray));
qie.debug('The variable javasciptArray contains: ' + javasciptArray);
Second, note that we first needed access to the Arrays class. Next simply wrap the javaArray to be converted to a string in Arrays.toString().
The javaArrayList and javasciptArray do not need this special treament. They are automatically convert to a string when the are concatenated to a string using the "+" operator.