title: In my list i have a object with null property and i want to remove this object but while checking in if condition its ConcurrentModificationException
body: <p>My code is as follows</p>
  
  <pre><code>for(User user: userList){
              if(user.getName()==null){
                  userList.remove(user);
              }
          }
  </code></pre>
  
  <p>here i am checking for null value of name property but it trows null pointer exception on checking the condition</p>
  
  <p>StackTrace</p>
  
  <pre><code>java.util.ConcurrentModificationException
      at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
      at java.util.ArrayList$Itr.next(Unknown Source)
      at in.net.usit.dbu.web.transformation.TransformationViewModel.initializeData(TransformationViewModel.java:106)
      at in.net.usit.dbu.web.transformation.TransformationViewModel.init(TransformationViewModel.java:91)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:111)
      at org.zkoss.bind.impl.AbstractAnnotatedMethodInvoker.invokeMethod(AbstractAnnotatedMethodInvoker.java:87)
      at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:170)
      at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:534)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:836)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:782)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:691)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:753)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:713)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:655)
      at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1036)
      at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
      at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
      at org.zkoss.zul.Include.afterCompose(Include.java:450)
      at org.zkoss.zul.Include.onAfterCompose(Include.java:434)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2725)
      at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2655)
      at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
      at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1721)
      at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1506)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1216)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:601)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:483)
      at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:492)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
  </code></pre>
  
  <p>this is the stacktrace i don't how to find the solution please help me with that</p>