private String[] validateUiRules(BladderManagement voBladderManagement) { ArrayList<String> listOfErrors = new ArrayList<String>(); if (voBladderManagement.getMethod() != null && !BladderManagementMethod.INTERMITTENT_CATHETER.equals(voBladderManagement.getMethod())) { if (voBladderManagement.getDateInserted() == null) { listOfErrors.add("Date Inserted is mandatory"); } if (voBladderManagement.getDateNextChange() == null) { listOfErrors.add("Date Next Change is mandatory"); } } int errorCount = listOfErrors.size(); String[] result = new String[errorCount]; for (int x = 0; x < errorCount; x++) result[x] = (String) listOfErrors.get(x); return result; }