### Question:
OpenNLPService implements NLPService { @Override public Intent[] recognize(String text) { try { String[] sentences = detectSentence(text); List<Intent> resultIntents = new ArrayList<>(); for(String sentence : sentences) { List<Intent> subResultIntents = new ArrayList<>(); String[] tokens = tokenize(sentence); Span[] resultSpans = findName(tokens); for (Span span : resultSpans) { StringBuilder sb = new StringBuilder(); sb.append(tokens[span.getStart()]); for(int i = span.getStart()+1 ; i < span.getEnd() ; i++) { sb.append(" " + tokens[i]); } subResultIntents.add(new Intent(sb.toString())); } Long id = findId(tokens); String date = findDate(tokens); for(Intent intent : subResultIntents) { intent.addParameter("ID", id); intent.addParameter("Date", date); } resultIntents.addAll(subResultIntents); } Intent[] intents = new Intent[resultIntents.size()]; for(int i = 0 ; i < resultIntents.size() ; i++) { intents[i] = resultIntents.get(i); } return intents; } catch (IOException e) { logger.error("Cannot read model information : ", e); } return null; }  @Override Intent[] recognize(String text);  }### Answer:
@Test public void recognizeTest() { Intent[] results = nlpService.recognize("check my next due date, date is 2017/09/13"); for(int i = 0; i < results.length ;i++) { log.info(results[i].getKeyword()); } Assert.assertTrue(hasKeyword(results, "next due date")); }