@Test
  public void testReplicaFromLeaderToStandby() {
    MockStatsManager mockStatsManager =
        new MockStatsManager(storageManager, mockClusterMap, replicas, new MetricRegistry(), statsManagerConfig,
            clusterParticipant, dataNodeId);
    // state transition on existing replica should be no-op
    clusterParticipant.onPartitionBecomeStandbyFromLeader(replicas.get(0).getPartitionId().toPathString());
  }
Test state transition in stats manager from LEADER to STANDBY
ambry-server/src/test/java/com/github/ambry/server/StatsManagerTest.java