RefSet Java implementataion