In this note we study the optimal dividend problem for a company whose surplus process, in the absence of dividend payments, evolves as a generalized compound Poisson model in which the counting process is a generalized Poisson process. This model includes the classical risk model and the Pólya-Aeppli risk model as special cases. The objective is to find a dividend policy so as to maximize the expected discounted value of dividends which are paid to the shareholders until the company is ruined. We show that under some conditions the optimal dividend strategy is formed by a barrier strategy. Moreover, two conjectures are proposed.