private void validateProperty(String configType, Map<String, String> config, String propertyName, Stack stack) {
    relevantProps.stream()
      .filter(each -> each.hasTypeAndName(configType, propertyName))
      .findFirst()
      .ifPresent(relevantProperty -> checkUnit(config, stack, relevantProperty));
  }
I validate the unit of properties by checking if it matches to the stack defined unit.
Properties with different unit than the stack defined unit are rejected.
ambari-server/src/main/java/org/apache/ambari/server/topology/validators/UnitValidator.java