Main steps
Create Human class which implements Humanoid interface:
Create Martian class, which implements Humanoid, Alien and Cloneable interfaces:
Implement methods according to the required logic, which is described in interface definitions and expected results from unit tests.
Notes:
When clone() is called for Martian, its structure should be cloned recursively for content of all stomaches. You can do it by implementing internal method clone(Object) like this:
Implement toString() method for Human and Martian classes in following format:
where ClassName is Human for human and Martian for martian.
For example, if current object is martian and its stomach contains another martian and then human with 3 in its stomach, it should show: