I have a Fit bin, I also have FitTableModel and JTable for it to display a list of beans. Fit has one method, which, when called, should change other rows of the table. In short, some analogue grouping. I moved all three classes into one package, and put the area of visibility of the method of interest only inside the package. Thus, it will be possible to change this bin field only through FitTableModel, so that it can change the values of the neighboring lines according to the corresponding rules. Am I right? Or are there other more beautiful options?