C3 linearization implementation in java