}
@Test
public void purchaserEqualsHisSubclassWhenAllTheirFieldsEqual() throws Exception {
Purchaser purchaserJohn = aPurchaser().withId(1L).withName("John")
.withAddress("blah-blah 11").withNip("111-22-33-4444").build();
Purchaser purchaserJohnSubclassed = new Purchaser() {
// this is subclass of Purchaser.class
private static final long serialVersionUID = 1L;
};
purchaserJohnSubclassed.setId(purchaserJohn.getId());
purchaserJohnSubclassed.setName(purchaserJohn.getName());
purchaserJohnSubclassed.setAddress(purchaserJohn.getAddress());
purchaserJohnSubclassed.setNip(purchaserJohn.getNip());
assertEquals(purchaserJohn, purchaserJohnSubclassed);
}