VoicePrint implements Serializable { void merge(double[] features) { if(this.features.length != features.length) { throw new IllegalArgumentException("Features of new VoicePrint is of different size : [" + features.length + "] expected [" + this.features.length + "]"); } w.lock(); try { merge(this.features, features); meanCount++; } finally { w.unlock(); } } VoicePrint();   VoicePrint(double[] features);   VoicePrint(VoicePrint print); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void mergeThrowsIllegalArgumentExceptionWhenFeaturesSizeIsDifferentThanInitial() { voicePrint.merge(new double[features1.length + 1]); }