Add memoclasses in Java