splitting off from the interview_problems; this one is Java-specific