Anyone knows how to use the Instrumentation to restransform the classes which have been loaded in java?

I create a java agent. At the beginning I added the transformer for some classes. But after some time, I want to remove the transformer by Instumentation.removeTransform but it does not work. And I tried to use Instrumentation.retransform the classes which added tranformer. But it still does not work. Anyone can help me? thanks