fail if condition not met in java if condition code example Example: fail if condition not met in java if condition throw new RuntimeException();