public void  park(Car car){
       if(rulesManager.isFull()){
           System.out.println("Hello Chandan the parking lot is full. You wait until a car exits");
           return;
       }
       Integer parkingLotNumber = rulesManager.getNearestParkingLot();
       ParkingLot parkingLot = new ParkingLot(parkingLotNumber,car);
       String color = car.getColor();
       ArrayList<ParkingLot> parkingLots;
       if(parkingLotsBelongingToColor.containsKey(color)){
            parkingLots= parkingLotsBelongingToColor.get(color);
           parkingLots.add(parkingLot);
       }
       else{
           parkingLots = new ArrayList<ParkingLot>();
           parkingLots.add(parkingLot);
       }
       parkingLotsBelongingToColor.put(color,parkingLots);
       parkingLotHashMap.put(parkingLot.getCar().getRegistrationNumber(),parkingLotNumber);
       rulesManager.park(parkingLotNumber);
       System.out.println("Car with reg number : "+car.getRegistrationNumber()+"is parked in the slot : "+parkingLotNumber);
   }