public synchronized void requestOffsetResetIfPartitionAssigned(TopicPartition partition) {
        final TopicPartitionState state = assignedStateOrNull(partition);
        if (state != null) {
            state.reset(defaultResetStrategy);
        }
    }
@Test
    public void testRequestOffsetResetIfPartitionAssigned() {
        state.assignFromUser(Collections.singleton(tp0));
        final TopicPartition unassignedPartition = new TopicPartition("unassigned", 0);

        state.requestOffsetResetIfPartitionAssigned(tp0);

        assertTrue(state.isOffsetResetNeeded(tp0));

        state.requestOffsetResetIfPartitionAssigned(unassignedPartition);

        assertThrows(IllegalStateException.class, () -> state.isOffsetResetNeeded(unassignedPartition));
    }