code: private void validateAllPolicies(Collection<PolicyInfo> all) 
      throws IOException, NumberFormatException {
      for (PolicyInfo pinfo: all) {
        Path srcPath = pinfo.getSrcPath();
        if (srcPath == null) {
          throw new IOException("Unable to find srcPath in policy.");
        }
        if (pinfo.getProperty("replication") == null) {
          throw new IOException("Unable to find replication in policy." +  
                                srcPath);
        }
        int repl = Integer.parseInt(pinfo.getProperty("replication"));
        if (pinfo.getProperty("modTimePeriod") == null) {
          throw new IOException("Unable to find modTimePeriod in policy." + 
                                srcPath);
        }
        long value = Long.parseLong(pinfo.getProperty("modTimePeriod"));
        List<PathInfo> dpaths = pinfo.getDestPaths();
        if (dpaths == null || dpaths.size() == 0) {
          throw new IOException("Unable to find dest in policy." +  srcPath);
        }
        for (PathInfo pp: dpaths) {
          if (pp.getPath() == null)  {
            throw new IOException("Unable to find valid destPath in policy " +
                                  srcPath);
          }
          if (pp.getProperty("replication") == null) {
            throw new IOException("Unable to find dest replication in policy." +  
                                  srcPath);
          }
          repl = Integer.parseInt(pp.getProperty("replication"));
        }
      }
    }
docs: Validate a collection of policies