202122232425262728
* @throws MyEntityNotFoundException * if {@code entity} is null */ public static <T> T checkEntityExists(final T entity) { if (entity == null) { throw new MyEntityNotFoundException(); } return entity; }
2728293031323334
return entity; } public static void checkEntityExists(final boolean entityExists) { if (!entityExists) { throw new MyEntityNotFoundException(); } }