Replace static method at runtime