@Test
public void testHashCode() {

    String msg_A = "A Test Message";
    // clusterwide with msg_A
    ChiefControllerMessageEvent ccme_A_clusterwide = new ChiefControllerMessageEvent();
    ccme_A_clusterwide.setMsg(msg_A);
    ccme_A_clusterwide.setClusterWideMessage(true);
    // not clusterwiede with same msg_A
    ChiefControllerMessageEvent ccme_A = new ChiefControllerMessageEvent();
    ccme_A.setMsg(msg_A);
    ccme_A.setClusterWideMessage(false);
    // same objects are equal according to the equals method (see other equal testcase)
    assertTrue("MUST BE SAME HASHCODE: same objectRefs, clusterwide", ccme_A_clusterwide.hashCode() == ccme_A_clusterwide.hashCode());
    // subsequent call must still remain the same hashcode
    assertTrue("MUST BE SAME HASHCODE: same objectRefs, clusterwide", ccme_A_clusterwide.hashCode() == ccme_A_clusterwide.hashCode());
    assertTrue("MUST BE SAME HASHCODE: same objectRefs", ccme_A.hashCode() == ccme_A.hashCode());
    assertTrue("MUST BE SAME HASHCODE: same objectRefs", ccme_A.hashCode() == ccme_A.hashCode());
    /*
     * compare A with B, both with same message
     */
    String msg_B = "A Test Message";
    // clusterwide with msg_B
    ChiefControllerMessageEvent ccme_B_clusterwide = new ChiefControllerMessageEvent();
    ccme_B_clusterwide.setMsg(msg_B);
    ccme_B_clusterwide.setClusterWideMessage(true);
    // not clusterwiede with same msg_B
    ChiefControllerMessageEvent ccme_B = new ChiefControllerMessageEvent();
    ccme_B.setMsg(msg_B);
    ccme_B.setClusterWideMessage(false);
    // A and B's are equal
    assertTrue("MUST BE SAME HASHCODE: same message, and both clusterwide", ccme_A_clusterwide.hashCode() == ccme_B_clusterwide.hashCode());
    assertTrue("MUST BE SAME HASHCODE: same message, and both clusterwide", ccme_A_clusterwide.hashCode() == ccme_B_clusterwide.hashCode());
    assertTrue("MUST BE SAME HASHCODE: same message", ccme_A.hashCode() == ccme_B.hashCode());
    assertTrue("MUST BE SAME HASHCODE: same message", ccme_A.hashCode() == ccme_B.hashCode());
}