UUID id = UUID.randomUUID();
Map<String, Object> attributes1 = new HashMap<String, Object>();
attributes1.put(VirtualHost.NAME, "name1");
Set<UUID> childrenIds = Collections.singleton(UUID.randomUUID());
ConfigurationEntry entry1 = new ConfigurationEntry(id, VirtualHost.class.getSimpleName(), attributes1,
childrenIds, store);
Map<String, Object> attributes2 = new HashMap<String, Object>();
attributes2.put(VirtualHost.NAME, "name2");
ConfigurationEntry entry2 = new ConfigurationEntry(id, VirtualHost.class.getSimpleName(), attributes1,
childrenIds, store);
ConfigurationEntry entryWithDifferentId = new ConfigurationEntry(UUID.randomUUID(),
VirtualHost.class.getSimpleName(), attributes1, childrenIds, store);
assertTrue(entry1.equals(entry2));
assertFalse("Entries should be different because of different IDs", entry1.equals(entryWithDifferentId));
ConfigurationEntry entryWithDifferentChildId = new ConfigurationEntry(id,
VirtualHost.class.getSimpleName(), attributes1, Collections.singleton(UUID.randomUUID()), store);
assertFalse("Entries should be different because of different children", entry1.equals(entryWithDifferentChildId));
ConfigurationEntry entryWithDifferentName = new ConfigurationEntry(id,
VirtualHost.class.getSimpleName(), attributes2, childrenIds, store);
assertFalse("Entries should be different because of different attributes", entry1.equals(entryWithDifferentName));
ConfigurationEntry entryWithDifferentType = new ConfigurationEntry(id,
Broker.class.getSimpleName(), attributes1, childrenIds, store);
assertFalse("Entries should be different because of different types", entry1.equals(entryWithDifferentType));
}