Buggy code:
public class TTestImpl implements TTest { private DistributionFactory distributionFactory = null ; public TTestImpl ( ) { } public double pairedT ( double [ ] sample1 , double [ ] sample2 ) throws IllegalArgumentException , MathException { } public double pairedTTest ( double [ ] sample1 , double [ ] sample2 ) throws IllegalArgumentException , MathException { } public boolean pairedTTest ( double [ ] sample1 , double [ ] sample2 , double alpha ) throws IllegalArgumentException , MathException { } public double t ( double mu , double [ ] observed ) throws IllegalArgumentException { } public double t ( double mu , StatisticalSummary sampleStats ) throws IllegalArgumentException { } public double homoscedasticT ( double [ ] sample1 , double [ ] sample2 ) throws IllegalArgumentException { } public double t ( double [ ] sample1 , double [ ] sample2 ) throws IllegalArgumentException { } public double t ( StatisticalSummary sampleStats1 , StatisticalSummary sampleStats2 ) throws IllegalArgumentException { } public double homoscedasticT ( StatisticalSummary sampleStats1 , StatisticalSummary sampleStats2 ) throws IllegalArgumentException { } public double tTest ( double mu , double [ ] sample ) throws IllegalArgumentException , MathException { } public boolean tTest ( double mu , double [ ] sample , double alpha ) throws IllegalArgumentException , MathException { } public double tTest ( double mu , StatisticalSummary sampleStats ) throws IllegalArgumentException , MathException { } public boolean tTest ( double mu , StatisticalSummary sampleStats , double alpha ) throws IllegalArgumentException , MathException { } public double tTest ( double [ ] sample1 , double [ ] sample2 ) throws IllegalArgumentException , MathException { } public double homoscedasticTTest ( double [ ] sample1 , double [ ] sample2 ) throws IllegalArgumentException , MathException { } public boolean tTest ( double [ ] sample1 , double [ ] sample2 , double alpha ) throws IllegalArgumentException , MathException { } public boolean homoscedasticTTest ( double [ ] sample1 , double [ ] sample2 , double alpha ) throws IllegalArgumentException , MathException { } public double tTest ( StatisticalSummary sampleStats1 , StatisticalSummary sampleStats2 ) throws IllegalArgumentException , MathException { } public double homoscedasticTTest ( StatisticalSummary sampleStats1 , StatisticalSummary sampleStats2 ) throws IllegalArgumentException , MathException { } public boolean tTest ( StatisticalSummary sampleStats1 , StatisticalSummary sampleStats2 , double alpha ) throws IllegalArgumentException , MathException { } protected DistributionFactory getDistributionFactory ( ) { } protected double df ( double v1 , double v2 , double n1 , double n2 ) { } protected double t ( double m , double mu , double v , double n ) { } protected double t ( double m1 , double m2 , double v1 , double v2 , double n1 , double n2 ) { } protected double homoscedasticT ( double m1 , double m2 , double v1 , double v2 , double n1 , double n2 ) { } protected double tTest ( double m , double mu , double v , double n ) throws MathException { } protected double tTest ( double m1 , double m2 , double v1 , double v2 , double n1 , double n2 ) throws MathException { } protected double homoscedasticTTest ( double m1 , double m2 , double v1 , double v2 , double n1 , double n2 ) throws MathException { <START_BUG> double t = Math . abs ( t ( m1 , m2 , v1 , v2 , n1 , n2 ) ) ; <END_BUG> double degreesOfFreedom = 0 ; degreesOfFreedom = ( ( double ) ( ( n1 + n2 ) - 2 ) ) ; TDistribution tDistribution = getDistributionFactory ( ) . createTDistribution ( degreesOfFreedom ) ; return 1.0 - ( tDistribution . cumulativeProbability ( ( - t ) , t ) ) ; } }

Fix:
double t = Math . abs ( homoscedasticT ( m1 , m2 , v1 , v2 , n1 , n2 ) ) ;