HomePieceOfFurniture piece1 = new HomePieceOfFurniture(firstPiece);
home.addPieceOfFurniture(piece1);
home.setSelectedItems(Arrays.asList(new HomePieceOfFurniture [] {piece1}));
// 2. Create a home piece of furniture panel to edit piece
HomeFurnitureController controller = new HomeFurnitureController(home, preferences, viewFactory, contentManager, null);
// Check values stored by furniture panel components are equal to the ones set
assertFurnitureControllerEquals(piece1.getName(), piece1.getX(),
piece1.getY(), piece1.getElevation(), (int)Math.toDegrees(piece1.getAngle()), piece1.getWidth(),
piece1.getDepth(), piece1.getHeight(), piece1.getColor(),
piece1.isVisible(), piece1.isModelMirrored(), controller);
// 3. Add a second selected piece to home
HomePieceOfFurniture piece2 = new HomePieceOfFurniture(firstPiece);
home.addPieceOfFurniture(piece2);
piece2.setX(piece1.getX());
piece2.setY(piece1.getY() + 10);
piece2.setElevation(piece1.getElevation() + 10);
piece2.setWidth(piece1.getWidth());
piece2.setDepth(piece1.getDepth() + 10);
piece2.setHeight(piece1.getHeight() + 10);
piece2.setColor(0xFF00FF);
piece2.setVisible(!piece1.isVisible());
piece2.setModelMirrored(!piece1.isModelMirrored());
home.setSelectedItems(Arrays.asList(new HomePieceOfFurniture [] {piece1, piece2}));
// Check if furniture panel edits null values
// if some furniture properties are the same
controller = new HomeFurnitureController(home, preferences, viewFactory, contentManager, null);
// Check values stored by furniture panel components are equal to the ones set
assertFurnitureControllerEquals(piece1.getName(), piece1.getX(), null, null, (int)Math.toDegrees(piece1.getAngle()),
piece1.getWidth(), null, null, null, null, null, controller);
// 4. Display furniture dialog