if (parkingParty != null && parkingParty.getParty().isPerson()) {
if (parkingParty.getParty().isPerson()) {
    private void addRow(final Spreadsheet parkingBDSpreadsheet, ParkingParty parkingParty,            Map<String, Object> accessTableRow) throws FenixServiceException {        long thisInstant = Calendar.getInstance().getTimeInMillis();        DateTime dateTime = new DateTime(thisInstant);        final Row row = parkingBDSpreadsheet.addRow();        Person person = null;        if (parkingParty != null && parkingParty.getParty().isPerson()) {            person = (Person) parkingParty.getParty();        }        row.setCell(((Short) accessTableRow.get("Garage")).toString());        if (parkingParty != null) {            row.setCell(parkingParty.getCardNumber().toString()); // cardNumber        } else {            row.setCell((String) accessTableRow.get("Card"));        }        row.setCell(((Short) accessTableRow.get("Type")).toString());        row.setCell(getBooleanString(accessTableRow.get("Access"))); // if the card is active or not        if (parkingParty != null) {            row.setCell(convertParkingGroupToAccessDB(parkingParty.getParkingGroup())); // accessGroup        } else {            row.setCell(((Short) accessTableRow.get("AccessGroup")).toString());        }        row.setCell(((Short) accessTableRow.get("Fee")).toString());        row.setCell(((Short) accessTableRow.get("SAC")).toString());        row                .setCell(DateFormatUtil.format("dd/MM/yyyy HH:mm:ss", (Date) accessTableRow                        .get("AlterDate")));        row.setCell(DateFormatUtil.format("dd/MM/yyyy HH:mm:ss", (Date) accessTableRow                .get("CreatedDate")));        row.setCell(dateTime.toString("dd/MM/yyyy HH:mm:ss")); // editedDate        if (parkingParty != null) {            row.setCell(person != null ? getName(person.getNickname()) : getName(parkingParty.getParty()                    .getName())); // name        } else {            row.setCell((String) accessTableRow.get("Name"));        }        row.setCell((String) accessTableRow.get("Address"));        if (parkingParty != null) {            row.setCell(parkingParty.getFirstCarPlateNumber() != null ? parkingParty                    .getFirstCarPlateNumber() : ""); // license        } else {            row.setCell((String) accessTableRow.get("License"));        }        if (parkingParty != null) {            row.setCell(parkingParty.getSecondCarPlateNumber() != null ? parkingParty                    .getSecondCarPlateNumber() : ""); // licenseAlt        } else {            row.setCell((String) accessTableRow.get("LicenseAlt"));        }        row.setCell(person != null && person.getWorkPhone() != null ? person.getWorkPhone() : ""); // registration        row.setCell(person != null && person.getMobile() != null ? person.getMobile() : ""); // registrationAlt        row.setCell((String) accessTableRow.get("ClientRef"));        row.setCell((String) accessTableRow.get("Comment"));        row.setCell(((Integer) accessTableRow.get("Price")).toString());        String endValidityDate = parkingParty.getCardEndDate() == null ? "" : parkingParty                .getCardEndDate().toString("dd/MM/yyyy HH:mm:ss");        row.setCell(endValidityDate);        row.setCell(DateFormatUtil.format("dd/MM/yyyy HH:mm:ss", (Date) accessTableRow                .get("LastUsedDate")));        row.setCell(getBooleanString(accessTableRow.get("Invoice")));        row.setCell(parkingParty.getCardStartDate() != null ? "FALSE" : "TRUE"); // if true, start and end validity dates are ignored        row.setCell(getBooleanString(accessTableRow.get("Present")));        row.setCell(getBooleanString(accessTableRow.get("PayDirect")));        row.setCell(getBooleanString(accessTableRow.get("APBCorrect"))); // if it's already in the park        row.setCell(getBooleanString(accessTableRow.get("NoFee")));        String startValidityDate = parkingParty.getCardStartDate() == null ? "" : parkingParty                .getCardStartDate().toString("dd/MM/yyyy HH:mm:ss");        row.setCell(startValidityDate);    }