### Question:
DataTypeStackHash { public String calculateParentHash(final DataType reference) { return getParent(reference) .map(dataType -> calculateHash(dataType, dataType.getName())) .orElse(""); } @Inject  DataTypeStackHash(final DataTypeStore dataTypeStore); String calculateHash(final DataType dataType); String calculateParentHash(final DataType reference);  }### Answer:
@Test public void testCalculateParentHash() { index(tCity, tCityId, tCityName, tPerson, tPersonId, tPersonName, tPersonCity, tPersonCityId, tPersonCityName); assertEquals("", dataTypeStackHash.calculateParentHash(tCity)); assertEquals("tCity", dataTypeStackHash.calculateParentHash(tCityId)); assertEquals("tCity", dataTypeStackHash.calculateParentHash(tCityName)); assertEquals("", dataTypeStackHash.calculateParentHash(tPerson)); assertEquals("tPerson", dataTypeStackHash.calculateParentHash(tPersonId)); assertEquals("tPerson", dataTypeStackHash.calculateParentHash(tPersonName)); assertEquals("tPerson", dataTypeStackHash.calculateParentHash(tPersonCity)); assertEquals("tPerson.city", dataTypeStackHash.calculateParentHash(tPersonCityId)); assertEquals("tPerson.city", dataTypeStackHash.calculateParentHash(tPersonCityName)); }