### Question:
GloveAnswerQuestionContext extends AnswerScorer { @Override public double scoreAnswer(Question q, Answer a) { List<float[]> qtokens = q.memo(Phrase.simpleTokens) .stream().map(DenseVectors::vectorFor) .filter(v -> v.isPresent()) .map(v ->v.get()) .collect(Collectors.toList()); List<float[]> atokens = a.memo(Phrase.simpleTokens) .stream().map(DenseVectors::vectorFor) .filter(v -> v.isPresent()) .map(v -> v.get()) .collect(Collectors.toList()); return DenseVectors.sim(DenseVectors.mean(atokens), DenseVectors.mean(qtokens)); }  @Override double scoreAnswer(Question q, Answer a);  }### Answer:
@Test public void testScoreAnswer() { GloveAnswerQuestionContext scorer = new GloveAnswerQuestionContext(); assertEquals(scorer.scoreAnswer(new Question("frog"), new Answer("toad")), 0.73, 0.01); assertEquals(scorer.scoreAnswer(new Question("frog"), new Answer("maple")), 0.23, 0.01); assertEquals(scorer.scoreAnswer( new Question("Who was Marilyn Monroe's second husband?"), new Answer("Joe Dimaggio")), 0.26, 0.01); assertEquals(scorer.scoreAnswer( new Question("Who was Marilyn Monroe's ^&^*()(*&$%^% 7868769987 jhgkjhgbnvbnuyr second husband?"), new Answer("Joe Dimaggio")), 0.26, 0.01); assertEquals(scorer.scoreAnswer( new Question("Who was Marilyn Monroe's second husband?"), new Answer("husband")), 0.71, 0.01); assertEquals(scorer.scoreAnswer( new Question("34986 **(&)(*& uiuytiuytiuyti"), new Answer("iuyoiuyoiuyhjjkhg")), 0.0, 0.01); assertEquals(scorer.scoreAnswer( new Question("democracy"), new Answer("")), 0.0, 0.01); }