@@ -0,0 +1,1255 @@
+package com.njust.test;%0A%0Aimport java.util.Objects;%0A%0Aimport org.junit.Test;%0A%0Apublic class CloneDemo%0A%7B%0A    %0A    /**%0A     * %E5%AE%9E%E7%8E%B0%E5%85%8B%E9%9A%86%E9%9C%80%E8%A6%81%EF%BC%9A%0A     * 1. %E5%AE%9E%E7%8E%B0cloneable%E6%8E%A5%E5%8F%A3%0A     * 2. override%E6%96%B9%E6%B3%95clone%0A     * @throws CloneNotSupportedException%0A     */%0A    @Test%0A    public void test()%0A        throws CloneNotSupportedException%0A    %7B%0A        Book book = new Book(1);%0A        Book book2 = (Book)book.clone();%0A        System.out.println(book.equals(book2));%0A    %7D%0A    %0A    static class Book implements Cloneable%0A    %7B%0A        private int price;%0A        %0A        public Book(int price)%0A        %7B%0A            this.price = price;%0A        %7D%0A        %0A        @Override%0A        protected Object clone()%0A            throws CloneNotSupportedException%0A        %7B%0A            return super.clone();%0A        %7D%0A        %0A        @Override%0A        public boolean equals(Object o)%0A        %7B%0A            if (this == o)%0A            %7B%0A                return true;%0A            %7D%0A            if (o == null %7C%7C getClass() != o.getClass())%0A            %7B%0A                return false;%0A            %7D%0A            Book book = (Book)o;%0A            return price == book.price;%0A        %7D%0A        %0A        @Override%0A        public int hashCode()%0A        %7B%0A            return Objects.hash(price);%0A        %7D%0A    %7D%0A%7D%0A

Create CloneDemo.java