'How can I convert a diagram to Java code?

I have a figure need to convert to Java code..

This is the figure: figure

Is this Java code correct?

class Insurance_company {
    private ArrayList<contract> Insurance_contract;
}

class Insurance_contract {
    private Insurance_company company;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source