VideoFormat extends Format implements Cloneable { @Override public VideoFormat clone() { return new VideoFormat(getName().clone(), frameRate); } protected  VideoFormat(EncodingName name); protected  VideoFormat(EncodingName name, int frameRate); protected  VideoFormat(String name); protected  VideoFormat(String name, int frameRate); int getFrameRate(); void setFrameRate(int frameRate); @Override VideoFormat clone(); @Override String toString();  }
@Test public void testCloneExecutionTime() { VideoFormat f = new VideoFormat("h261", 15); 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); }