### Question:
RaftLogMetadataCache { public RaftLogEntryMetadata getMetadata( long logIndex ) { return raftLogEntryCache.get( logIndex ); } RaftLogMetadataCache( int logEntryCacheSize ); void clear(); RaftLogEntryMetadata getMetadata( long logIndex ); RaftLogEntryMetadata cacheMetadata( long logIndex, long entryTerm, LogPosition position ); void removeUpTo( long upTo ); void removeUpwardsFrom( long startingFrom );  }### Answer:
@Test public void shouldReturnNullWhenMissingAnEntryInTheCache() { final RaftLogMetadataCache cache = new RaftLogMetadataCache( 2 ); final RaftLogMetadataCache.RaftLogEntryMetadata metadata = cache.getMetadata( 42 ); assertNull( metadata ); }