Correctly override clone method and junit it successfully.


public class SudokuData implements Cloneable {

    private int[] data = new int[82];

    @Override
    protected SudokuData clone() throws CloneNotSupportedException {
        SudokuData sd = new SudokuData();
        sd.data = data.clone();
        return sd;
    }
...........
-------------------------------------------
public class SudokuDataTest {
    static void show(String str){
        System.out.println(str);
    }
    public SudokuDataTest() {
    }

    /**
     * Test of clone method, of class SudokuData.
     */
    @Test
    public void testClone() throws Exception {
        SudokuData sd1=new SudokuData("12345");
        SudokuData sd2=new SudokuData();
        sd2=sd1.clone();
        show(sd1.toString());
        show(sd2.toString());
        sd2.setData(1, 9);
        show(sd1.toString());
        show(sd2.toString());
        
        
    }
..........
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.livehereandnow.sudoku.util.SudokuDataTest
123450000_000000000_000000000_000000000_000000000_000000000_000000000_000000000_000000000
123450000_000000000_000000000_000000000_000000000_000000000_000000000_000000000_000000000
123450000_000000000_000000000_000000000_000000000_000000000_000000000_000000000_000000000
923450000_000000000_000000000_000000000_000000000_000000000_000000000_000000000_000000000
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.082 sec

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
--------------------------------------------