@Override
    public boolean commitNeeded() {
        if (task.isActive()) {
            throw new UnsupportedOperationException("This task is read-only");
        }
        return task.commitNeeded();
    }
@Test
    public void shouldDelegateCommitNeededIfStandby() {
        final StandbyTask standbyTask =
            standbyTask(new TaskId(1, 0), mkSet(new TopicPartition("topic", 0))).build();
        final ReadOnlyTask readOnlyTask = new ReadOnlyTask(standbyTask);

        readOnlyTask.commitNeeded();

        verify(standbyTask).commitNeeded();
    }