@Test
public void testValidateEcard(){
HashSet<String> ecards = new HashSet<String>(Arrays.asList( new String[]{"3"} ));
Mockito.when(registry.getEcards()).thenReturn(ecards);
RunnerImpl runner = new RunnerImpl();
runner.setEcard("1");
assertTrue(runnerControl.validateEcard(runner, "1"));
assertEquals("1", runner.getEcard());
assertTrue(runnerControl.validateEcard(runner, "2"));
assertEquals("2", runner.getEcard());
assertTrue(runnerControl.validateEcard(runner, "2a"));
assertEquals("2a", runner.getEcard());
assertFalse(runnerControl.validateEcard(runner, "3"));
assertEquals("2a", runner.getEcard());
assertTrue(runnerControl.validateEcard(runner, ""));
assertEquals("", runner.getEcard());
}