### Question:
Journal implements Closeable { synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getLastPromisedEpoch()); } updateLastPromisedEpoch(epoch); abortCurSegment(); NewEpochResponseProto.Builder builder = NewEpochResponseProto.newBuilder(); EditLogFile latestFile = scanStorageForLatestEdits(); if (latestFile != null) { builder.setLastSegmentTxId(latestFile.getFirstTxId()); } return builder.build(); } Journal(File logDir, String journalId,
      StorageErrorReporter errorReporter); @Override // Closeable void close(); synchronized long getLastWriterEpoch(); void heartbeat(RequestInfo reqInfo); synchronized boolean isFormatted(); synchronized void startLogSegment(RequestInfo reqInfo, long txid); synchronized void finalizeLogSegment(RequestInfo reqInfo, long startTxId,
      long endTxId); synchronized void purgeLogsOlderThan(RequestInfo reqInfo,
      long minTxIdToKeep); RemoteEditLogManifest getEditLogManifest(long sinceTxId); synchronized PrepareRecoveryResponseProto prepareRecovery(
      RequestInfo reqInfo, long segmentTxId); synchronized void acceptRecovery(RequestInfo reqInfo,
      SegmentStateProto segment, URL fromUrl);  }### Answer:
@Test public void testNamespaceVerification() throws Exception { journal.newEpoch(FAKE_NSINFO, 1); try { journal.newEpoch(FAKE_NSINFO_2, 2); fail("Did not fail newEpoch() when namespaces mismatched"); } catch (IOException ioe) { GenericTestUtils.assertExceptionContains( "Incompatible namespaceID", ioe); } }