J.P. Morgan interview question

Implement a scenario with doubleton pattern using java