    @Test
    public void PosFilterTest() throws Exception {


        Map<String,Double> expectedResults = new HashMap<String,Double>();
        expectedResults.put("sentence", 1.6487752080270504);
        expectedResults.put("second", 0.8508165279819666);
        expectedResults.put("long", 0.5004082639909833);
        expectedResults.put("more", 0.5004082639909833);
        expectedResults.put("necessary", 0.8508165279819666);
        expectedResults.put("test", 1.6487752080270504);

        String testDocument = "This is a not so long test sentence. This is a longer second test sentence. More sentences are necessary for the tests.";

        AnalysisEngineDescription aggregate = createEngineDescription(
        		createEngineDescription(de.tudarmstadt.ukp.dkpro.core.tokit.BreakIteratorSegmenter.class),
                AnalysisEngineFactory.createEngineDescription(StanfordPosTagger.class,
                        StanfordPosTagger.PARAM_LANGUAGE, "en"),
                AnalysisEngineFactory.createEngineDescription(StanfordLemmatizer.class),
                createEngineDescription(
                        PosFilter.class,
                        PosFilter.PARAM_TYPE_TO_REMOVE, Lemma.class.getName(),
                        PosFilter.PARAM_ADJ, true,
                        PosFilter.PARAM_N, true
                ),
                CooccurrenceGraphFactory.getCooccurrenceGraph_lemma(),
                createEngineDescription(PageRankRanking.class,
                        PageRankRanking.PARAM_WEIGHTED, false));

        AnalysisEngine engine = AnalysisEngineFactory.createEngine(aggregate);
        JCas aJCas = engine.newJCas();
        aJCas.setDocumentText(testDocument);

        engine.process(aJCas);

        int i=0;
        for (Keyphrase keyphrase : JCasUtil.select(aJCas, Keyphrase.class)) {
//                System.out.println("\"" + keyphrase.getKeyphrase() + "\", " + keyphrase.getScore());
            assertTrue(keyphrase.getKeyphrase(), expectedResults.containsKey(keyphrase.getKeyphrase()));
            assertEquals(keyphrase.getKeyphrase(), expectedResults.get(keyphrase.getKeyphrase()), keyphrase.getScore(), EPSILON);
            i++;
        }
        assertEquals(10,i);
    }