private List<String> toList(String[] array){
  List<String> ret=new ArrayList<String>();
  if (array != null && array.length > 0) {
    ret.addAll(Arrays.asList(array));
  }
  return ret;
}

private List < String > toList ( String [ ] array ) { List < String > ret = new ArrayList < String > ( ) ; if ( array != null && array . length > 0 ) { ret . addAll ( Arrays . asList ( array ) ) ; } return ret ; }
returns a list of string by adding string in an array to it .
