synchronized boolean tryUpdatingHighWatermark(TopicPartition tp, long highWatermark) {
        final TopicPartitionState state = assignedStateOrNull(tp);
        if (state != null) {
            assignedState(tp).highWatermark(highWatermark);
            return true;
        }
        return false;
    }
@Test
    public void testTryUpdatingHighWatermark() {
        state.assignFromUser(Collections.singleton(tp0));
        final TopicPartition unassignedPartition = new TopicPartition("unassigned", 0);

        final long highWatermark = 10L;
        assertTrue(state.tryUpdatingHighWatermark(tp0, highWatermark));
        assertEquals(highWatermark, state.partitionEndOffset(tp0, IsolationLevel.READ_UNCOMMITTED));
        assertFalse(state.tryUpdatingHighWatermark(unassignedPartition, highWatermark));
    }