public static String getMasterForEntry(JournalEntry entry) {
    if (entry.hasAddMountPoint()
        || entry.hasAsyncPersistRequest()
        || entry.hasAddSyncPoint()
        || entry.hasActiveSyncTxId()
        || entry.hasCompleteFile()
        || entry.hasDeleteFile()
        || entry.hasDeleteMountPoint()
        || entry.hasInodeDirectory()
        || entry.hasInodeDirectoryIdGenerator()
        || entry.hasInodeFile()
        || entry.hasInodeLastModificationTime()
        || entry.hasNewBlock()
        || entry.hasPersistDirectory()
        || entry.hasRemoveSyncPoint()
        || entry.hasRename()
        || entry.hasSetAcl()
        || entry.hasSetAttribute()
        || entry.hasUpdateUfsMode()
        || entry.hasUpdateInode()
        || entry.hasUpdateInodeDirectory()
        || entry.hasUpdateInodeFile()
        || entry.hasLoadJob()
        || entry.hasCopyJob()
        || entry.hasMoveJob()) {
      return Constants.FILE_SYSTEM_MASTER_NAME;
    }
    if (entry.hasBlockContainerIdGenerator()
        || entry.hasDeleteBlock()
        || entry.hasBlockInfo()) {
      return Constants.BLOCK_MASTER_NAME;
    }
    if (entry.hasClusterInfo()
        || entry.hasPathProperties()
        || entry.hasRemovePathProperties()) {
      return Constants.META_MASTER_NAME;
    }
    if (entry.hasPolicyDefinition()
        || entry.hasPolicyRemove()) {
      return Constants.POLICY_ENGINE_NAME;
    }
    throw new IllegalStateException("Unrecognized journal entry: " + entry);
  }
@Test
  public void testUnknown() {
    mThrown.expect(IllegalStateException.class);
    JournalEntryAssociation.getMasterForEntry(JournalEntry.getDefaultInstance());
  }