@Test
	public void testMarker() {

		source.markColor("this", ColorConstants.WHITE);
		source.markColor("is", ColorConstants.BLACK);
		source.markColor("simple", ColorConstants.YELLOW);
		source.markColor("text", ColorConstants.YELLOW);

		List<Word> words = source.getKnownWords(ColorConstants.YELLOW);
		assertEquals(2, words.size());

		source.markColor("simple text", ColorConstants.BLACK);

		words = source.getKnownWords(ColorConstants.WHITE);
		assertEquals(1, words.size());
		assertEquals("this", words.get(0).getText());
		assertEquals(ColorConstants.WHITE, words.get(0).getColor());

		words = source.getKnownWords(ColorConstants.BLACK);
		assertEquals(2, words.size());
		assertTrue("is".equals(words.get(0).getText())
				|| "is".equals(words.get(1).getText()));
		assertTrue("simple text".equals(words.get(0).getText())
				|| "simple text".equals(words.get(1).getText()));
		assertEquals(ColorConstants.BLACK, words.get(0).getColor());
		assertEquals(ColorConstants.BLACK, words.get(1).getColor());

		words = source.getKnownWords(ColorConstants.YELLOW);
		assertEquals(2, words.size());
		assertTrue("simple".equals(words.get(0).getText())
				|| "simple".equals(words.get(1).getText()));
		assertTrue("text".equals(words.get(0).getText())
				|| "text".equals(words.get(1).getText()));
		assertEquals(ColorConstants.YELLOW, words.get(0).getColor());
		assertEquals(ColorConstants.YELLOW, words.get(1).getColor());

		source.process(new TextProcessor() {

			@Override
			public void updated(TextWithProperties textProperties) {
				assertEquals("simple", textProperties.getText());
				assertTrue(end[0]);
			}

			@Override
			public void got(TextWithProperties textProperties) {
				assertEquals(res.remove(0), textProperties.getText());
				if ("this".equals(textProperties.getText()))
					assertEquals(ColorConstants.WHITE,
							textProperties.getColor());
				else if ("is".equals(textProperties.getText()))
					assertEquals(ColorConstants.BLACK,
							textProperties.getColor());
				else if ("simple".equals(textProperties.getText()))
					assertEquals(ColorConstants.BLACK,
							textProperties.getColor());
				else if ("text".equals(textProperties.getText()))
					assertEquals(ColorConstants.BLACK,
							textProperties.getColor());
				else
					assertEquals(ColorConstants.DEFAULT,
							textProperties.getColor());
				assertFalse(end[0]);
			}

			@Override
			public void end() {
				assertTrue(res.isEmpty());
				end[0] = true;
			}
		});

		assertTrue(end[0]);
		assertTrue(res.isEmpty());

	}