### Question:
PieExecutorTaskFactory implements IPieExecutorTaskFactory { @Override public <X extends P, P extends IPieEvent, T extends IPieEventTask<P>> void registerTask(Class<X> event, Class<T> task) { Validate.notNull(event); Validate.notNull(task); this.tasks.put(event, task); }  void setBeanService(IBeanService beanService); void setTasks(Map<Class, Class> tasks); @Override IPieEventTask getTask(IPieEvent event); @Override void registerTask(Class<X> event, Class<T> task); @Override void removeTaskRegistration(Class<P> event);  }### Answer:
@Test public void testRegisterTask() { Map<Class, Class> map = Mockito.mock(Map.class); PieExecutorTaskFactory instance = new PieExecutorTaskFactory(); instance.setTasks(map); instance.registerTask(IPieEvent.class, IPieEventTask.class); Mockito.verify(map, Mockito.times(1)).put(IPieEvent.class, IPieEventTask.class); }
@Test(expectedExceptions = NullPointerException.class) public void testRegisterTaskEventNullValue() { PieExecutorTaskFactory instance = new PieExecutorTaskFactory(); instance.registerTask(null, IPieEventTask.class); }
@Test(expectedExceptions = NullPointerException.class) public void testRegisterTaskTaskNullValue() { PieExecutorTaskFactory instance = new PieExecutorTaskFactory(); instance.registerTask(IPieEvent.class, null); }