AudioFormat extends Format implements Cloneable { @Override public AudioFormat clone() { AudioFormat f = new AudioFormat(getName().clone(), sampleRate, sampleSize, channels); f.setOptions(this.getOptions()); return f; } protected  AudioFormat(EncodingName name); private  AudioFormat(EncodingName name, int sampleRate, int sampleSize, int channels); int getSampleRate(); void setSampleRate(int sampleRate); int getSampleSize(); void setSampleSize(int sampleSize); int getChannels(); void setChannels(int channels); @Override AudioFormat clone(); @Override boolean matches(Format other); @Override String toString();  }
@Test public void testCloneExecutionTime() { AudioFormat f = FormatFactory.createAudioFormat("pcmu", 8000, 8, 1); long s = System.currentTimeMillis(); for (int i = 0; i < 1000; i++) { f.clone(); } long duration = System.currentTimeMillis() - s; System.out.println("Execution time: " + duration); assertTrue("To slow", 3000000L > duration); }