### Question:
ThreadDumpFactory { static long parseLong(String value) { if (value.startsWith("0x")) { value = value.substring(2); } return new BigInteger(value, 16).longValue(); }  ThreadDumpFactory failOnErrors(boolean failOnErrors); @Nonnull ThreadDumpRuntime fromFile(@Nonnull File threadDump); @Nonnull ThreadDumpRuntime fromStream(@Nonnull InputStream stream); @Nonnull ThreadDumpRuntime fromString(@Nonnull String runtime);  }### Answer:
@Test public void parseLong() throws Exception { String top = "0xffffffffffffffff"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), -1, ThreadDumpFactory.parseLong(top)); top = "0xfffffffffffffffe"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), -2, ThreadDumpFactory.parseLong(top)); top = "0x00000000000000f"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), 15, ThreadDumpFactory.parseLong(top)); top = "0xf0000000000000"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), 67553994410557440L, ThreadDumpFactory.parseLong(top)); top = "0xe0000000000000"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), 63050394783186944L, ThreadDumpFactory.parseLong(top)); top = "0x7fffffffffffffff"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), 9223372036854775807L, ThreadDumpFactory.parseLong(top)); top = "0x8000000000000000"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), -9223372036854775808L, ThreadDumpFactory.parseLong(top)); top = "ffffffffe2875c0a"; assertEquals(Long.toHexString(ThreadDumpFactory.parseLong(top)), -494445558, ThreadDumpFactory.parseLong(top)); }