public void foo(){ //here, at compile time we use the one in EvoSuite dependency, but not at runtime AlreadySelectedException e = new AlreadySelectedException(null); if(e.toString().equals("foo")){ System.out.println("Only executed if SUT version is used, and not the one in EvoSuite's dependencies"); } } }