MachineState implements Serializable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MachineState state = (MachineState) o; if (failoverActive != state.failoverActive) return false; if (load != null ? !load.equals(state.load) : state.load != null) return false; return true; } MachineState(boolean failoverActive, Load load); private  MachineState(Load load, boolean failoverActive);  MachineState(boolean failoverActive, LoadLevel mainDbLoadLevel, LoadLevel failoverDbLoadLevel);  MachineState(boolean failoverActive, LoadLevel loadLevel, boolean mainDbLoadHigher);  MachineState(boolean failoverActive, LoadLevel loadLevel); @Override boolean equals(Object o); @Override int hashCode(); boolean isFailoverActive(); Load getLoad(); @Override String toString();  }
@Test public void shouldNotBeEqual() { List<MachineState> states1 = new ArrayList<MachineState>(); List<MachineState> states2 = new ArrayList<MachineState>(); addSomeNonEqualPairsOfStates(states1, states2); for (int i = 0; i < states1.size(); i++) { assertFalse(states1.get(i).equals(states2.get(i))); } }