@Override
        public List<? extends Device> chooseDevices(List<? extends Platform> platforms) {
            synchronized(sync) {
            if (currentDeviceIndex == -1) {
                return Collections.emptyList();
            }

            Platform platform = platforms.get(0);
            availableDevices = platform.getDevices();
            
            Device device = platform.getDevices().get(currentDeviceIndex);
            currentDeviceIndex ++;
            if (currentDeviceIndex >= availableDevices.size()) {
                currentDeviceIndex = -1;
            }
            
            return Collections.singletonList(device);
            }
        }
@param args the command line arguments
jme3-examples/src/main/java/jme3test/opencl/TestMultipleApplications.java