### Question:
GraphModel implements Serializable { public String getHash() { int hashCode; try { hashCode = Arrays.hashCode(toByteArray()); } catch (IOException e) { throw new IllegalStateException(e); } return Integer.toString(Math.abs(hashCode), 16); } GraphModel(final Vocabulary schemaVocabulary,
                      final Partitioner vertexPartitioner,
                      final LinkedHashMap<QualifiedName, EdgeModel> edgeModels,
                      final LinkedHashMap<QualifiedName, PropertyModel> vertexPropertyModels,
                      final LinkedHashMap<QualifiedName, PropertyModel> edgePropertyModels); Partitioner getVertexPartitioner(); Map<QualifiedName, EdgeModel> getEdgeModels(); Map<QualifiedName, PropertyModel> getVertexPropertyModels(); Map<QualifiedName, PropertyModel> getEdgePropertyModels(); Vocabulary getSchemaVocabulary(); String getHash();  }### Answer:
@Test public void modelHashesAreUnique() throws Exception { Vocabulary vocabulary = createVocabulary(); Partitioner vertexPartitioner = new Partitioner(); vertexPartitioner.put(new QualifiedName("Monkey"), 1); vertexPartitioner.put(new QualifiedName("Weasel"), 1); LinkedHashMap<QualifiedName, EdgeModel> edgeModel = new LinkedHashMap<>(); edgeModel.put(new QualifiedName("chased"), edge( domain(new QualifiedName("Monkey"), 0.9543, 0.7813873, 1.0293729), domain(new QualifiedName("Weasel"), 1.0000))); LinkedHashMap<QualifiedName, PropertyModel> vertexPropertyModels = new LinkedHashMap<>(); LinkedHashMap<QualifiedName, PropertyModel> edgePropertyModels = new LinkedHashMap<>(); GraphModel model = new GraphModel( vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); String firstHash = model.getHash(); String secondHash = model.getHash(); assertEquals(firstHash, secondHash); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); secondHash = model.getHash(); assertEquals(firstHash, secondHash); vertexPartitioner.put(new QualifiedName("MulberryBush"), 5); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); secondHash = model.getHash(); assertNotEquals(firstHash, secondHash); vertexPartitioner.put(new QualifiedName("MulberryBush"), 5); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); String thirdHash = model.getHash(); assertEquals(secondHash, thirdHash); vertexPartitioner.put(new QualifiedName("MulberryBush"), 7); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); thirdHash = model.getHash(); assertNotEquals(secondHash, thirdHash); edgeModel = new LinkedHashMap<>(); edgeModel.put(new QualifiedName("chased"), edge( domain(new QualifiedName("Monkey"), 0.9543, 0.7813873, 1.0293729), domain(new QualifiedName("Weasel"), 0.5))); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); String fifthHash = model.getHash(); assertNotEquals(thirdHash, fifthHash); edgeModel = new LinkedHashMap<>(); edgeModel.put(new QualifiedName("chased"), edge( domain(new QualifiedName("Monkey"), 0.9543, 0.5, 1.5), domain(new QualifiedName("Weasel"), 0.5))); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); String sixthHash = model.getHash(); assertNotEquals(fifthHash, sixthHash); edgeModel.put(new QualifiedName("popped"), edge( domain(new QualifiedName("Weasel"), 0.5), domain(new QualifiedName("Monkey"), 0.5))); model = new GraphModel(vocabulary, vertexPartitioner, edgeModel, vertexPropertyModels, edgePropertyModels); String seventhHash = model.getHash(); assertNotEquals(sixthHash, seventhHash); }