### Question:
ReadOnlyRequestsCache { public List<String> getReadOnlyRequestsByFrequency() { return _readOnlyRequests.getKeysSortedByValue( ATOMLONG_COMP ); } ReadOnlyRequestsCache(); boolean readOnlyRequest( final String requestId ); void modifyingRequest( final String requestId ); boolean isReadOnlyRequest( final String requestId ); List<String> getReadOnlyRequests(); List<String> getReadOnlyRequestsByFrequency();  }### Answer:
@Test public void testGetReadOnlyRequestsByFrequency() { final ReadOnlyRequestsCache cut = new ReadOnlyRequestsCache(); cut.readOnlyRequest( "foo" ); cut.readOnlyRequest( "bar" ); cut.readOnlyRequest( "bar" ); assertTrue( Arrays.equals( new String[] { "foo", "bar" }, cut.getReadOnlyRequestsByFrequency().toArray() ) ); cut.readOnlyRequest( "foo" ); cut.readOnlyRequest( "foo" ); assertTrue( Arrays.equals( new String[] { "bar", "foo" }, cut.getReadOnlyRequestsByFrequency().toArray() ) ); }