code: public boolean isMasterInSameMachine(ClusterComponentContainer container) {
          final String machineName = persistentData.pmName;
          final PhysicalMachineCluster machineInfo = container.getPmc(machineName, getClusterName());
          final List<Integer> localPgsIdList = machineInfo.getPgsIdList();
          
          for (final Integer id : localPgsIdList) {
              PartitionGroupServer anotherPGS = container.getPgs(getClusterName(), String.valueOf(id));
              if (persistentData.pgId == anotherPGS.persistentData.pgId
                      && anotherPGS.persistentData.role.equals(PGS_ROLE_MASTER)
                      && machineName.equals(anotherPGS.persistentData.pmName)) {
                  return true;
              }
          }
          return false;
      }
docs: /*
  Return true, if a master PGS and a slave PGS are in the same machine and
  both are in the same PG. For instance, If an instance of this class and
  Master PGS are in the same machine than this function return true,
  otherwise return false.