imperative java extractMood method implemented