private static void sellToStation(AIPlayer player) {
        Station station = player.getCurrentStar().getStation();
        CargoHoldComponent hold = player.getShip().getCargoHold().get();

        // find best value item to sell that player has in cargo and wasn't just
        // bought
        if (hold.getCargoSpaceUsage() > 0) {
            int greatestDifference = 0;
            CargoEnum bestCargoEnum = null;
            for (CargoEnum cargoEnum : CargoEnum.getList()) {
                if (hold.getCargoAmount(cargoEnum) > 0) {
                    int s = station.getTransactionPrice(cargoEnum);
                    int p = player.getTransactionPrice(cargoEnum);
                    int difference = s - p;
                    if (difference > greatestDifference && !player.isRecentlyPurchased(cargoEnum)) {
                        greatestDifference = difference;
                        bestCargoEnum = cargoEnum;
                    }
                }

            }

            // sell max of that item
            if (bestCargoEnum != null && player.isBestSellPrice(bestCargoEnum, station.getTransactionPrice(bestCargoEnum))) {
                int maxSaleAmount = TransactionManager.getMaximumAmount(station.getWallet().getCredits(),
                        station.getTransactionPrice(bestCargoEnum),
                        station.getShip().getCargoHold().get().getRemainingCargoSpace(), bestCargoEnum.getSize(),
                        hold.getCargoAmount(bestCargoEnum));
                if (TransactionManager.validateSellToStationTransaction(player, station, bestCargoEnum, maxSaleAmount) == 0) {
                    TransactionManager.performSellToStationTransaction(player, station, bestCargoEnum, maxSaleAmount);
                    player.addRecentlyPurchased(bestCargoEnum);
                    // //System.out.println("sold " + maxSaleAmount + " " +
                    // bestCargoEnum);
                }
            }
        }
    }