### Question:
RmiJournalReceiver extends UnicastRemoteObject implements RmiJournalReceiverInterface { public void closeFile() throws JournalException { if (journalFile == null) { throw logAndGetException("Attempting to close a file " + "when no file is open."); } try { writer.close(); journalFile.close(); } catch (IOException e) { throw logAndGetException("Problem closing the file '" + journalFile.getName() + "'", e); } logger.debug("closing file: '" + journalFile.getName() + "'"); journalFile = null; } RmiJournalReceiver(RmiJournalReceiverArguments arguments); void exportAndBind(); void openFile(String repositoryHash, String filename); void writeText(String indexedHash, String text); void closeFile(); static void main(String[] args);  }### Answer:
@Test public void testCloseWithoutOpen() throws RemoteException, JournalException { RmiJournalReceiver receiver = createReceiver(new String[] { journalDirectory.getAbsolutePath(), "1234", "1235", "FATAL"}); try { receiver.closeFile(); fail("Expected an exception."); } catch (JournalException e) { } }