Eclipse template (code snippet ) to check the argument and eventually throws IllegalArgumentException
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="java" deleted="false" description="check argument for null" enabled="true" name="nullp">
if( ${name:var} == null ) throw new java.lang.IllegalArgumentException( "${name} is null!");
</template>
</templates>