### Question:
ServiceFactory { public DataService create(String type, DaoSession daoSession) { switch (type){ case "kino": return new KinoService(daoSession); case "serie": return new SerieService(daoSession, context); } throw new NullPointerException("Unable to find a service for this type."); } ServiceFactory(Context baseContext); DataService create(String type, DaoSession daoSession);  }### Answer:
@Test public void kinoService() { assertTrue(new ServiceFactory(context).create("kino", daoSession) instanceof KinoService); }
@Test public void serieService() { assertTrue(new ServiceFactory(context).create("serie", daoSession) instanceof SerieService); }
@Test(expected = NullPointerException.class) public void unexistingService() { new ServiceFactory(context).create("banane", daoSession); }