buildingInformation.setSpace(new OldBuilding("Some other building"));
buildingInformation.setSpace(new Building("Some other building"));
    public void testSetSpace() {        final OldBuilding building = new OldBuilding("Some building");        final BuildingInformation buildingInformation = building.getSpaceInformation();        try {            buildingInformation.setSpace(null);            fail("Expected a NullPointerException: building information must be relative to a building.");        } catch (NullPointerException ex) {            assertEquals("error.building.cannot.be.null", ex.getMessage());        }        try {            buildingInformation.setSpace(building);            fail("Expected a DomainException: cannot change the building of a building information.");        } catch (DomainException ex) {            assertEquals("error.cannot.change.building", ex.getMessage());        }        try {            buildingInformation.setSpace(new OldBuilding("Some other building"));            fail("Expected a DomainException: cannot change the building of a building information.");        } catch (DomainException ex) {            assertEquals("error.cannot.change.building", ex.getMessage());        }        try {            buildingInformation.setSpace(new SpaceImpl());            fail("Expected a DomainException: cannot associate a building information with a space that is not a building.");        } catch (DomainException ex) {            assertEquals("error.incompatible.space", ex.getMessage());        }    }