public void updateTaskConfig(Map<String, String> taskConfig) {
        try {
            taskLifecycleLock.lock();
            if (!Objects.equals(this.taskConfigReference, taskConfig)) {
                logger.info("Updating task '" + name + "' configuration");
                taskConfigReference = taskConfig;
                reconfigurationNeeded = true;
            }
        } finally {
            taskLifecycleLock.unlock();
        }
    }
@Test
    public void should_reconfigure_task() {
        assertPolledRecordsSize(CONFIGURED_ITEMS_SIZE);
        connector.setProperty(ITEMS_SIZE, String.valueOf(5));
        assertPolledRecordsSize(CONFIGURED_ITEMS_SIZE);

        taskRunner.updateTaskConfig(dummyTaskConfig());

        assertPolledRecordsSize(5);
    }