Pergunta de entrevista da empresa Fidelity Investments

Given a string, write Java code to print words appearing 2 or more times