/** Test of setBeta method, of class LatentDirichletAllocationVectorGibbsSampler. */ @Test public void testSetBeta() { double beta = LatentDirichletAllocationVectorGibbsSampler.DEFAULT_BETA; LatentDirichletAllocationVectorGibbsSampler instance = new LatentDirichletAllocationVectorGibbsSampler(); assertEquals(beta, instance.getBeta(), 0.0); beta = 1.1; instance.setBeta(beta); assertEquals(beta, instance.getBeta(), 0.0); boolean exceptionThrown = false; try { instance.setBeta(0.0); } catch (IllegalArgumentException e) { exceptionThrown = true; } finally { assertTrue(exceptionThrown); } assertEquals(beta, instance.getBeta(), 0.0); exceptionThrown = false; try { instance.setBeta(-0.1); } catch (IllegalArgumentException e) { exceptionThrown = true; } finally { assertTrue(exceptionThrown); } assertEquals(beta, instance.getBeta(), 0.0); }