Buggy code:
public class EigenDecompositionImpl implements EigenDecomposition { private static final double TOLERANCE = 100 * ( MathUtils . EPSILON ) ; private static final double TOLERANCE_2 = ( EigenDecompositionImpl . TOLERANCE ) * ( EigenDecompositionImpl . TOLERANCE ) ; private double splitTolerance ; private double [ ] main ; private double [ ] secondary ; private double [ ] squaredSecondary ; private TriDiagonalTransformer transformer ; private double lowerSpectra ; private double upperSpectra ; private double minPivot ; private double sigma ; private double sigmaLow ; private double tau ; private double [ ] work ; private int pingPong ; private double qMax ; private double eMin ; private int tType ; private double dMin ; private double dMin1 ; private double dMin2 ; private double dN ; private double dN1 ; private double dN2 ; private double g ; private double [ ] realEigenvalues ; private double [ ] imagEigenvalues ; private ArrayRealVector [ ] eigenvectors ; private RealMatrix cachedV ; private RealMatrix cachedD ; private RealMatrix cachedVt ; public EigenDecompositionImpl ( final RealMatrix matrix , final double splitTolerance ) throws InvalidMatrixException { } public EigenDecompositionImpl ( final double [ ] main , double [ ] secondary , final double splitTolerance ) throws InvalidMatrixException { } private boolean isSymmetric ( final RealMatrix matrix ) { } private void decompose ( ) { } public RealMatrix getV ( ) throws InvalidMatrixException { } public RealMatrix getD ( ) throws InvalidMatrixException { } public RealMatrix getVT ( ) throws InvalidMatrixException { } public double [ ] getRealEigenvalues ( ) throws InvalidMatrixException { } public double getRealEigenvalue ( final int i ) throws ArrayIndexOutOfBoundsException , InvalidMatrixException { } public double [ ] getImagEigenvalues ( ) throws InvalidMatrixException { } public double getImagEigenvalue ( final int i ) throws ArrayIndexOutOfBoundsException , InvalidMatrixException { } public RealVector getEigenvector ( final int i ) throws ArrayIndexOutOfBoundsException , InvalidMatrixException { } public double getDeterminant ( ) { } public DecompositionSolver getSolver ( ) { } private static class Solver implements DecompositionSolver { private double [ ] realEigenvalues ; private double [ ] imagEigenvalues ; private final ArrayRealVector [ ] eigenvectors ; private Solver ( final double [ ] realEigenvalues , final double [ ] imagEigenvalues , final ArrayRealVector [ ] eigenvectors ) { } public double [ ] solve ( final double [ ] b ) throws IllegalArgumentException , InvalidMatrixException { } public RealVector solve ( final RealVector b ) throws IllegalArgumentException , InvalidMatrixException { } public RealMatrix solve ( final RealMatrix b ) throws IllegalArgumentException , InvalidMatrixException { } public boolean isNonSingular ( ) { } public RealMatrix getInverse ( ) throws InvalidMatrixException { } } private void transformToTridiagonal ( final RealMatrix matrix ) { } private void computeGershgorinCircles ( ) { } private void findEigenvalues ( ) throws InvalidMatrixException { } private List < Integer > computeSplits ( ) { } private void process1RowBlock ( final int index ) { } private void process2RowsBlock ( final int index ) throws InvalidMatrixException { } private void process3RowsBlock ( final int index ) throws InvalidMatrixException { } private void processGeneralBlock ( final int n ) throws InvalidMatrixException { } private void initialSplits ( final int n ) { } private int goodStep ( final int start , final int end ) { } private boolean flipIfWarranted ( final int n , final int step ) { if ( ( 1.5 * ( work [ pingPong ] ) ) < ( work [ ( ( 4 * ( n - 1 ) ) + ( pingPong ) ) ] ) ) { <START_BUG> int j = ( 4 * n ) - 1 ; <END_BUG> for ( int i = 0 ; i < j ; i += 4 ) { for ( int k = 0 ; k < 4 ; k += step ) { final double tmp = work [ ( i + k ) ] ; work [ ( i + k ) ] = work [ ( j - k ) ] ; work [ ( j - k ) ] = tmp ; } j -= 4 ; } return true ; } return false ; } private double [ ] eigenvaluesRange ( final int index , final int n ) { } private int countEigenValues ( final double t , final int index , final int n ) { } private void ldlTDecomposition ( final double lambda , final int index , final int n ) { } private void dqds ( final int start , final int end ) { } private void dqd ( final int start , final int end ) { } private void computeShiftIncrement ( final int start , final int end , final int deflated ) { } private void updateSigma ( final double shift ) { } private void findEigenVectors ( ) { } private ArrayRealVector findEigenvector ( final double eigenvalue , final double [ ] d , final double [ ] l ) { } private void stationaryQuotientDifferenceWithShift ( final double [ ] d , final double [ ] l , final double lambda ) { } private void progressiveQuotientDifferenceWithShift ( final double [ ] d , final double [ ] l , final double lambda ) { } }

Fix:
int j = 4 * ( n - 1 ) ;