Buggy code:
public class ArrayRealVector extends RealVector implements Serializable { private static final long serialVersionUID = - 1097961340710804027L ; private static final RealVectorFormat DEFAULT_FORMAT = RealVectorFormat . getInstance ( ) ; private double [ ] data ; public ArrayRealVector ( ) { } public ArrayRealVector ( int size ) { } public ArrayRealVector ( int size , double preset ) { } public ArrayRealVector ( double [ ] d ) { } public ArrayRealVector ( double [ ] d , boolean copyArray ) { } public ArrayRealVector ( double [ ] d , int pos , int size ) { } public ArrayRealVector ( Double [ ] d ) { } public ArrayRealVector ( Double [ ] d , int pos , int size ) { } public ArrayRealVector ( RealVector v ) { } public ArrayRealVector ( ArrayRealVector v ) { } public ArrayRealVector ( ArrayRealVector v , boolean deep ) { } public ArrayRealVector ( ArrayRealVector v1 , ArrayRealVector v2 ) { } public ArrayRealVector ( ArrayRealVector v1 , RealVector v2 ) { } public ArrayRealVector ( RealVector v1 , ArrayRealVector v2 ) { } public ArrayRealVector ( ArrayRealVector v1 , double [ ] v2 ) { } public ArrayRealVector ( double [ ] v1 , ArrayRealVector v2 ) { } public ArrayRealVector ( double [ ] v1 , double [ ] v2 ) { } @ Override public ArrayRealVector copy ( ) { } @ Override public ArrayRealVector add ( RealVector v ) { } @ Override public ArrayRealVector subtract ( RealVector v ) { } @ Override public ArrayRealVector map ( UnivariateFunction function ) { } @ Override public ArrayRealVector mapToSelf ( UnivariateFunction function ) { } @ Override public RealVector mapAddToSelf ( double d ) { } @ Override public RealVector mapSubtractToSelf ( double d ) { } @ Override public RealVector mapMultiplyToSelf ( double d ) { } @ Override public RealVector mapDivideToSelf ( double d ) { } @ Override public ArrayRealVector ebeMultiply ( RealVector v ) { } @ Override public ArrayRealVector ebeDivide ( RealVector v ) { } public double [ ] getDataRef ( ) { } @ Override public double dotProduct ( RealVector v ) { } @ Override public double getNorm ( ) { } @ Override public double getL1Norm ( ) { } @ Override public double getLInfNorm ( ) { } @ Override public double getDistance ( RealVector v ) { } @ Override public double getL1Distance ( RealVector v ) { } @ Override public double getLInfDistance ( RealVector v ) { } @ Override public RealVector unitVector ( ) { } @ Override public void unitize ( ) { } @ Override public RealVector projection ( RealVector v ) { } @ Override public RealMatrix outerProduct ( RealVector v ) { } @ Override public double getEntry ( int index ) { } @ Override public int getDimension ( ) { } @ Override public RealVector append ( RealVector v ) { } public ArrayRealVector append ( ArrayRealVector v ) { } @ Override public RealVector append ( double in ) { } @ Override public RealVector getSubVector ( int index , int n ) { } @ Override public void setEntry ( int index , double value ) { } @ Override public void addToEntry ( int index , double increment ) { } @ Override public void setSubVector ( int index , RealVector v ) { } public void setSubVector ( int index , double [ ] v ) { } @ Override public void set ( double value ) { } @ Override public double [ ] toArray ( ) { } @ Override public String toString ( ) { } @ Override protected void checkVectorDimensions ( RealVector v ) { } @ Override protected void checkVectorDimensions ( int n ) { } @ Override public boolean isNaN ( ) { } @ Override public boolean isInfinite ( ) { } @ Override public boolean equals ( Object other ) { if ( ( this ) == other ) { return true ; } <START_BUG> if ( ( other == null ) || ( ! ( other instanceof RealVector ) ) ) { <END_BUG> return false ; } RealVector rhs = ( ( RealVector ) ( other ) ) ; if ( ( data . length ) != ( rhs . getDimension ( ) ) ) { return false ; } if ( rhs . isNaN ( ) ) { return this . isNaN ( ) ; } for ( int i = 0 ; i < ( data . length ) ; ++ i ) { if ( ( data [ i ] ) != ( rhs . getEntry ( i ) ) ) { return false ; } } return true ; } @ Override public int hashCode ( ) { } @ Override public ArrayRealVector combine ( double a , double b , RealVector y ) { } @ Override public ArrayRealVector combineToSelf ( double a , double b , RealVector y ) { } }

Fix:
if ( ! ( other instanceof RealVector ) ) {