Exemple

public class ClassA {
public void methodA {

//...
System.exit(0);
}

Solution
Emettez une exception RuntimeException à la place.

public class ClassA {
public void methodA throws RuntimeException {

//...
throw new RuntimeException();
}