private boolean isLineFromUserAndId(Element line,User user,String id){
  for (int j=0; j < 20; j++) {
    Element element=line.getElement(j);
    User elementUser=getUserFromElement(element);
    if (elementUser == user) {
      if (id == null || id.equals(getIdFromElement(element))) {
        return true;
      }
    }
    if (elementUser != null) {
      return false;
    }
  }
  return false;
}

private boolean isLineFromUserAndId ( Element line , User user , String id ) { for ( int j = 0 ; j < 20 ; j ++ ) { Element element = line . getElement ( j ) ; User elementUser = getUserFromElement ( element ) ; if ( elementUser == user ) { if ( id == null || id . equals ( getIdFromElement ( element ) ) ) { return true ; } } if ( elementUser != null ) { return false ; } } return false ; }
checks if the given element is a line that is associated with the given user .
