public synchronized FetchPosition positionOrNull(TopicPartition tp) {
        final TopicPartitionState state = assignedStateOrNull(tp);
        if (state == null) {
            return null;
        }
        return assignedState(tp).position;
    }
@Test
    public void testPositionOrNull() {
        state.assignFromUser(Collections.singleton(tp0));
        final TopicPartition unassignedPartition = new TopicPartition("unassigned", 0);
        state.seek(tp0, 5);

        assertEquals(5, state.positionOrNull(tp0).offset);
        assertNull(state.positionOrNull(unassignedPartition));
    }