To do internal logic checks, there are two ways in Java,
- use the assert keyword: e.g, assert(x>y);
- manually throw assertion error: e.g, if(y>x) throw new AssertionError();
What are the differences among above two methods( performance wise, programming flexibility, etc.? Which one is considered as a good programming practice?