public static List<UserLayer> extractUserLayers(StyledLayerDescriptor sld){
  List<UserLayer> userLayerList=new ArrayList<UserLayer>();
  if (sld != null) {
    for (    StyledLayer layer : sld.layers()) {
      if (layer instanceof UserLayer) {
        UserLayer userLayer=(UserLayer)layer;
        userLayerList.add(userLayer);
      }
    }
  }
  return userLayerList;
}

public static List < UserLayer > extractUserLayers ( StyledLayerDescriptor sld ) { List < UserLayer > userLayerList = new ArrayList < UserLayer > ( ) ; if ( sld != null ) { for ( StyledLayer layer : sld . layers ( ) ) { if ( layer instanceof UserLayer ) { UserLayer userLayer = ( UserLayer ) layer ; userLayerList . add ( userLayer ) ; } } } return userLayerList ; }
extract user layers from an sld .
