What I'm trying to accomplish is to have a error checking class mostly to check if parameters that are pass null but also data structures within class are not null.  So my thought is a clean static method call to pass these variables and verify if it's valid, and if so, return a boolean.For example, my code is seems to have a lot of repetitive checking. Yes, I know it might be too much, but I been ask to do so. So it's out of my control whether it's too much but I think there's some merit to it. But how should I got about making a class for this?public class RAMUserDAO implements GenericDAO<User, String, Boolean>{    private static Map<String, User> activeUserMap = new ConcurrentHashMap<String, User>();    private static Map<String, User> banUserMap = new ConcurrentHashMap<String, User>();    public RAMUserDAO()    {    }    @Override    public boolean insert(User user, Boolean active) throws NotFoundException        {            if (user == null || user.getUserName() == null                    || !(user instanceof User))                throw new NotFoundException(RAMUserDAO insert);            if (active)            {                if (activeUserMap.get(user.getUserName()) != null)                    throw new NotFoundException(                            RAMUserDAO insert active User Exist);                activeUserMap.put(user.getUserName(), user);                LOG.SYSTEM.info(User:  + user.getUserName()                        + has been added RAMUserDAO);                return true;            }            else            {                if (banUserMap.get(user.getUserName()) != null)                    throw new NotFoundException(                            RAMUserDAO insert ban User Exist NULL);                banUserMap.put(user.getUserName(), user);                LOG.SYSTEM.info(User:  + user.getUserName()                        + has been banned RAMUserDAO);                return true;            }        }    @Override    public boolean update(User user, Boolean active) throws NotFoundException        {            if (!isUser(user, active))                throw new NotFoundException(User update RAMUserDAO);            if (active)            {                activeUserMap.put(user.getUserName(), user);                LOG.SYSTEM.info(User:  + user.getUserName()                        + has been updated RAMUserDAO);                return true;            }            else            {                banUserMap.put(user.getUserName(), user);                LOG.SYSTEM.info(Ban User:  + user.getUserName()                        + has been updated RAMUserDAO);                return true;            }        }    @Override    public boolean delete(User user, Boolean active) throws NotFoundException        {            if (!isUser(user, active))                throw new NotFoundException(User delete RAMUserDAO);            if (active)            {                activeUserMap.remove(user.getUserName());                LOG.SYSTEM.info(User:  + user.getUserName()                        + has been removed RAMUserDAO);                return true;            }            else            {                banUserMap.remove(user.getUserName());                LOG.SYSTEM.info(Ban User:  + user.getUserName()                        + has been removed RAMUserDAO);                return true;            }        }    @Override    public User findByKey(String key, Boolean active) throws NotFoundException        {            if (!isUser(key, active))                throw new NotFoundException(User findByKey RAMUserDAO);            if (active)            {                return activeUserMap.get(key);            }            else            {                return banUserMap.get(key);            }        }    @Override    public User findByValue(User user, Boolean active) throws NotFoundException        {            if (!isUser(user, active))                throw new NotFoundException(User findByValue RAMUserDAO);            if (active)            {                return activeUserMap.get(user.getUserName());            }            else            {                return banUserMap.get(user.getUserName());            }        }    private boolean isUser(String userName, Boolean active)            throws NotFoundException        {            if (userName == null)                throw new NotFoundException(RAMUserDAO isUser string null);            if (active)            {                // LOG.CONSOLE.debug(activeUserMap);                // LOG.CONSOLE.debug(activeUserMap.get(userName));                if (activeUserMap == null                        || activeUserMap.get(userName) == null)                    throw new NotFoundException(RAMUserDAO isUser);            }            else            {                if (banUserMap == null || banUserMap.get(userName) == null)                    throw new NotFoundException(RAMUserDAO isUser);            }            return true;        }    private boolean isUser(User user, Boolean active) throws NotFoundException        {            if (user == null || user.getUserName() == null                    || !(user instanceof User))                throw new NotFoundException(RAMUserDAO isUser);            if (active)            {                if (activeUserMap == null                        || activeUserMap.get(user.getUserName()) == null)                    throw new NotFoundException(RAMUserDAO isUser);            }            else            {                if (banUserMap == null                        || banUserMap.get(user.getUserName()) == null)                    throw new NotFoundException(RAMUserDAO isUser);            }            return true;        }    /**     * @return the userList     * @throws NotFoundException     */    public Map<String, User> getMap() throws NotFoundException        {            if (activeUserMap == null)                throw new NotFoundException(getUserList RAMUserDAO null);            return activeUserMap;        }    /**     * @return the banList     * @throws NotFoundException     */    public static Map<String, User> getBanList() throws NotFoundException        {            if (banUserMap == null) throw new NotFoundException();            return banUserMap;        }}
Creating check parameter class instead of repetitive null checks
java;error handling;null