private realize design pattern by java