private ArrayList<Integer> getUsedServices(MyOrderChildComponentVoCollection components, ArrayList<Integer> serviceIDs) { if (components == null) return serviceIDs; if (serviceIDs == null) serviceIDs = new ArrayList<Integer>(); for (MyOrderChildComponentVo component : components) { if (component.getServiceID() != null) { serviceIDs.add(component.getServiceID()); } } return serviceIDs; }