AudioFormat extends Format implements Cloneable { @Override public boolean matches(Format other) { if (!super.matches(other)) return false; AudioFormat f = (AudioFormat) other; if (f.sampleRate != this.sampleRate) return false; if (f.channels != this.channels) return false; return true; } 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 testMatch() { AudioFormat f1 = FormatFactory.createAudioFormat("linear", 8000, 16, 1); AudioFormat f2 = FormatFactory.createAudioFormat("LINEAR", 8000, 16, 1); assertTrue("Formats must match", f1.matches(f2)); }