### Question:
UnitValidator implements TopologyValidator { @Override public void validate(ClusterTopology topology) throws InvalidTopologyException { Stack stack = topology.getBlueprint().getStack(); validateConfig(topology.getConfiguration().getFullProperties(), stack); for (HostGroupInfo hostGroup : topology.getHostGroupInfo().values()) { validateConfig(hostGroup.getConfiguration().getFullProperties(), stack); } } UnitValidator(Set<UnitValidatedProperty> propertiesToBeValidated); @Override void validate(ClusterTopology topology);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void rejectsPropertyWithDifferentUnitThanStackUnit() throws Exception { stackUnitIs("property1", "MB"); propertyToBeValidatedIs("property1", "12G"); validate("property1"); }
@Test public void acceptsPropertyWithSameUnitThanStackUnit() throws Exception { stackUnitIs("property1", "MB"); propertyToBeValidatedIs("property1", "12m"); validate("property1"); }
@Test public void skipsValidatingIrrelevantProperty() throws Exception { stackUnitIs("property1", "MB"); propertyToBeValidatedIs("property1", "12g"); validate("property2"); }