You could, for example, use the CDI "Alternatives".
@Alternative public class TestCoderImpl implements Coder { ... }
Now this bean will be used only if it is declared in your beans.xml as an alternative.
<alternatives> <class>package.TestCoderImpl</class> </alternatives>
Further information .
Csaba source share