Buggy code:
public class ClearVolumeDemo { private static ClearVolumeRendererInterface mClearVolumeRenderer ; public static void main ( String [ ] argv ) throws ClassNotFoundException { } @ Test public void demoOpenCLProcessors ( ) throws IOException , InterruptedException { } @ Test public void demoOpenCLTenengrad ( ) throws IOException , InterruptedException { } @ Test public void demoOpenCLHistogram ( ) throws IOException , InterruptedException { } @ Test public void demoDriftOverlay ( ) throws IOException , InterruptedException { } @ Test public void demoCudaProcessors ( ) throws IOException , InterruptedException { } @ Test public void demoGraphOverlay ( ) throws IOException , InterruptedException { } @ Test public void demoPathOverlay3D ( ) throws IOException , InterruptedException { } @ Test public void demoRendererInJFrame ( ) throws IOException , InterruptedException { } @ Test public void demoWith8BitGeneratedDataset ( ) throws IOException , InterruptedException { } @ Test public void demoAspectRatio ( ) throws IOException , InterruptedException { } @ Test public void demoAspectRatioPreset ( ) throws IOException , InterruptedException { } @ Test public void demoWith16BitGeneratedDataset ( ) throws IOException , InterruptedException { } @ Test public void demoWithGeneratedDatasetWithEgg3D ( ) throws IOException , InterruptedException { } @ Test public void demoWithFileDatasets ( ) { } @ Test public void demoWith8BitGeneratedDataset2Layers ( ) throws IOException , InterruptedException { <START_BUG> final ClearVolumeRendererInterface lClearVolumeRenderer = ClearVolumeRendererFactory . newBestRenderer ( "ClearVolumeTest" , 512 , 512 , 1 , 512 , 512 , 2 , false ) ; <END_BUG> lClearVolumeRenderer . setVisible ( true ) ; final int lResolutionX = 256 ; final int lResolutionY = lResolutionX ; final int lResolutionZ = lResolutionX ; final byte [ ] lVolumeDataArray0 = new byte [ ( lResolutionX * lResolutionY ) * lResolutionZ ] ; for ( int z = 0 ; z < lResolutionZ ; z ++ ) for ( int y = 0 ; y < lResolutionY ; y ++ ) for ( int x = 0 ; x < lResolutionX ; x ++ ) { final int lIndex = ( x + ( lResolutionX * y ) ) + ( ( lResolutionX * lResolutionY ) * z ) ; int lCharValue = ( ( ( byte ) ( x ) ) ^ ( ( byte ) ( y ) ) ) ^ ( ( byte ) ( z ) ) ; if ( lCharValue < 12 ) lCharValue = 0 ; lVolumeDataArray0 [ lIndex ] = ( ( byte ) ( lCharValue ) ) ; } lClearVolumeRenderer . setCurrentRenderLayer ( 0 ) ; lClearVolumeRenderer . setVolumeDataBuffer ( ByteBuffer . wrap ( lVolumeDataArray0 ) , lResolutionX , lResolutionY , lResolutionZ ) ; lClearVolumeRenderer . requestDisplay ( ) ; Thread . sleep ( 2000 ) ; final byte [ ] lVolumeDataArray1 = new byte [ ( lResolutionX * lResolutionY ) * lResolutionZ ] ; for ( int z = 0 ; z < ( lResolutionZ // 2 ) ; z ++ ) for ( int y = 0 ; y < ( lResolutionY // 2 ) ; y ++ ) for ( int x = 0 ; x < ( lResolutionX // 2 ) ; x ++ ) { final int lIndex = ( x + ( lResolutionX * y ) ) + ( ( lResolutionX * lResolutionY ) * z ) ; int lCharValue = 255 - ( ( ( ( byte ) ( x ) ) ^ ( ( byte ) ( y ) ) ) ^ ( ( byte ) ( z ) ) ) ; if ( lCharValue < 12 ) lCharValue = 0 ; lVolumeDataArray1 [ lIndex ] = ( ( byte ) ( lCharValue ) ) ; } lClearVolumeRenderer . setCurrentRenderLayer ( 1 ) ; lClearVolumeRenderer . setVolumeDataBuffer ( ByteBuffer . wrap ( lVolumeDataArray1 ) , lResolutionX , lResolutionY , lResolutionZ ) ; lClearVolumeRenderer . requestDisplay ( ) ; int i = 0 ; while ( lClearVolumeRenderer . isShowing ( ) ) { Thread . sleep ( 500 ) ; lClearVolumeRenderer . setLayerVisible ( ( i % 2 ) , ( ! ( lClearVolumeRenderer . isLayerVisible ( ( i % 2 ) ) ) ) ) ; lClearVolumeRenderer . requestDisplay ( ) ; i ++ ; } lClearVolumeRenderer . close ( ) ; } private static void startSample ( final String pRessourceName , final int pBytesPerVoxel , final int pSizeX , final int pSizeY , final int pSizeZ ) throws IOException , InterruptedException { } private static void startSample ( final InputStream pInputStream , final int pBytesPerVoxel , final int pSizeX , final int pSizeY , final int pSizeZ ) throws IOException , InterruptedException { } @ Test public void demoStressTest ( ) throws IOException , InterruptedException { } @ Test public void demoStressTestNewtCanvasAWT ( ) throws IOException , InterruptedException , InvocationTargetException { } private static byte [ ] loadData ( final InputStream pInputStream , final int pBytesPerVoxel , final int sizeX , final int sizeY , final int sizeZ ) throws IOException { } private static byte [ ] loadData ( final String pRessourceName , final int pBytesPerVoxel , final int sizeX , final int sizeY , final int sizeZ ) throws IOException { } }

Fix:
final ClearVolumeRendererInterface lClearVolumeRenderer = new JCudaClearVolumeRenderer ( "ClearVolumeTest" , 512 , 512 , 1 , 512 , 512 , 2 , false ) ;