public boolean hasMastersAndSecondaries() {
    return !getMasters().isEmpty() && !getSecondaries().isEmpty();
  }
@return true if both master and secondary components lists are not empty
ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java