@Test public void testCloning() throws CloneNotSupportedException { LogFormat f1 = new LogFormat(10.0, "10", true); LogFormat f2 = (LogFormat) f1.clone(); assertNotSame(f1, f2); assertSame(f1.getClass(), f2.getClass()); assertEquals(f1, f2); }
@Override public Object clone() { LogFormat clone = (LogFormat) super.clone(); clone.formatter = (NumberFormat) this.formatter.clone(); return clone; }
LogFormat extends NumberFormat { @Override public Object clone() { LogFormat clone = (LogFormat) super.clone(); clone.formatter = (NumberFormat) this.formatter.clone(); return clone; } }
LogFormat extends NumberFormat { @Override public Object clone() { LogFormat clone = (LogFormat) super.clone(); clone.formatter = (NumberFormat) this.formatter.clone(); return clone; } LogFormat();  LogFormat(double base, String baseLabel, boolean showBase);  LogFormat(double base, String baseLabel, String powerLabel,
            boolean showBase); }
LogFormat extends NumberFormat { @Override public Object clone() { LogFormat clone = (LogFormat) super.clone(); clone.formatter = (NumberFormat) this.formatter.clone(); return clone; } LogFormat();  LogFormat(double base, String baseLabel, boolean showBase);  LogFormat(double base, String baseLabel, String powerLabel,
            boolean showBase); NumberFormat getExponentFormat(); void setExponentFormat(NumberFormat format); @Override StringBuffer format(double number, StringBuffer toAppendTo,
            FieldPosition pos); @Override StringBuffer format(long number, StringBuffer toAppendTo,
            FieldPosition pos); @Override Number parse(String source, ParsePosition parsePosition); @Override boolean equals(Object obj); @Override Object clone(); }
LogFormat extends NumberFormat { @Override public Object clone() { LogFormat clone = (LogFormat) super.clone(); clone.formatter = (NumberFormat) this.formatter.clone(); return clone; } LogFormat();  LogFormat(double base, String baseLabel, boolean showBase);  LogFormat(double base, String baseLabel, String powerLabel,
            boolean showBase); NumberFormat getExponentFormat(); void setExponentFormat(NumberFormat format); @Override StringBuffer format(double number, StringBuffer toAppendTo,
            FieldPosition pos); @Override StringBuffer format(long number, StringBuffer toAppendTo,
            FieldPosition pos); @Override Number parse(String source, ParsePosition parsePosition); @Override boolean equals(Object obj); @Override Object clone();  }