Example

public class ClassA {
public void methodA {

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

Solução
Emita uma RuntimeException.

public class ClassA {
public void methodA throws RuntimeException {

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