FileBasedLexicon implements Lexicon { public Sentiment get(String key) { final String value = properties.getProperty(key); return value == null ? Sentiment.NEUTRAL : Sentiment.valueOf(value); } FileBasedLexicon(String fileName); Sentiment get(String key); @Override String toString();  }
@Test public void testLexicon() throws Exception { final FileBasedLexicon lexicon = new FileBasedLexicon("lexicon.properties"); assertEquals(Sentiment.HAPPY, lexicon.get("devoxx")); assertEquals(Sentiment.SAD, lexicon.get("framework")); }