code: public static List<Group> filterLigands(List<Group> allGroups) {
  
  		List<Group> groups = new ArrayList<Group>();
  		for (Group g : allGroups) {
  
  			if ( g.isPolymeric())
  				continue;
  
  			if (!g.isWater()) {
  				groups.add(g);
  			}
  		}
  
  		return groups;
  	}
docs: Removes all polymeric and solvent groups from a list of groups