Symple observer class in java