Accounting engine in java