public static List<HsErrPid> buildHsErrPidList() {
		final List<File> directories = new ArrayList<>();
		// locations of fatal error log:
		// http://www.oracle.com/technetwork/java/javase/felog-138657.html
		directories.add(new File("./"));
		// linux:
		directories.add(new File("/tmp"));
		// windows:
		final String tmp = System.getenv("TMP");
		if (tmp != null) {
			directories.add(new File(tmp));
		}
		final List<String> args = ManagementFactory.getRuntimeMXBean().getInputArguments();
		for (final String arg : args) {
			if (arg.startsWith(XX_ERROR_FILE)) {
				final String errorFile = arg.substring(XX_ERROR_FILE.length());
				final File dir = new File(errorFile).getParentFile();
				if (dir != null) {
					directories.add(dir);
				}
			}
		}

		final List<HsErrPid> result = new ArrayList<>();
		for (final File dir : directories) {
			final File[] files = dir.listFiles(FILENAME_FILTER);
			if (files != null) {
				for (final File file : files) {
					result.add(new HsErrPid(file.getAbsolutePath(), new Date(file.lastModified())));
				}
			}
		}
		return result;
	}
@Test
	public void testBuildHsErrPidList() throws IOException {
		final List<HsErrPid> hsErrPidList = HsErrPid.buildHsErrPidList();
		final File file = new File("./hs_err_pid12345.log");
		final File file2 = new File("./hs_err_pid67890.log");
		final File file3 = new File("./hs_err_pid12345.notlog");
		try {
			file.createNewFile();
			file2.createNewFile();
			file3.createNewFile();
			final List<HsErrPid> hsErrPidList2 = HsErrPid.buildHsErrPidList();
			assertEquals("buildHsErrPidList", hsErrPidList.size() + 2, hsErrPidList2.size());
			for (final HsErrPid hsErrPid : hsErrPidList2) {
				assertNotNull("getDate", hsErrPid.getDate());
				assertNotNull("getFile", hsErrPid.getFile());
			}
			final JavaInformations javaInformations = new JavaInformations(null, true);
			final JavaInformations javaInformations2 = new JavaInformations(null, false);
			final List<HsErrPid> hsErrPidList3 = HsErrPid
					.getHsErrPidList(List.of(javaInformations, javaInformations2));
			assertEquals("buildHsErrPidList", hsErrPidList.size() + 2, hsErrPidList3.size());
		} finally {
			file.delete();
			file2.delete();
			file3.delete();
		}
	}