ObliterateDelegator extends BaseDelegator implements IObliterateDelegator { @Override public List<IObliterateResult> obliterateFiles( @Nonnull final List<IFileSpec> fileSpecs, final ObliterateFilesOptions opts) throws P4JavaException { Validate.notNull(fileSpecs); List<IObliterateResult> obliterateResults = new ArrayList<>(); List<Map<String, Object>> resultMaps = execMapCmdList( OBLITERATE, processParameters(opts, fileSpecs, server), null); if (nonNull(resultMaps)) { boolean reportOnly = false; if (resultMaps.size() > 1) { Map<String, Object> lastResultMap = resultMaps.get(resultMaps.size() - 1); reportOnly = nonNull(lastResultMap) && lastResultMap.containsKey(REPORT_ONLY); } try { List<IFileSpec> fsList = new ArrayList<>(); for (Map<String, Object> map : resultMaps) { String errStr = handleFileErrorStr(map); if (isBlank(errStr)) { if (map.containsKey(PURGE_FILE)) { FileSpec fs = createPurgeFileSpecFromMap(map); fsList.add(fs); } else if (map.containsKey(REVISION_REC_DELETED)) { IObliterateResult result = createObliterateResultFromMapIfRevisionRecordsDeleted( map, fsList, reportOnly); obliterateResults.add(result); fsList = new ArrayList<>(); } } else { FileSpec fs = createInfoOrErrorFileSpecFromMap( map, errStr, new Function<Map<String, Object>, Boolean>() { @Override public Boolean apply(Map<String, Object> map) { return isInfoMessage(map); } }); fsList.add(fs); IObliterateResult result = new ObliterateResult(fsList, 0, 0, 0, 0, 0, 0, reportOnly); obliterateResults.add(result); } } } catch (Exception exc) { Log.error("Unexpected exception in ObliterateFileSpec constructor %s", exc.getLocalizedMessage()); Log.exception(exc); } } return obliterateResults; } ObliterateDelegator(IOptionsServer server); @Override List<IObliterateResult> obliterateFiles(
            @Nonnull final List<IFileSpec> fileSpecs,
            final ObliterateFilesOptions opts);  }
@Test public void shouldThrownNullPointerExceptionWhenFileSpecsIsNull() throws Exception { thrown.expect(NullPointerException.class); fileSpecs = null; obliterateDelegator.obliterateFiles(fileSpecs, opts); }