POSG computation for GridSmall.posg in java