InternalRecord extends InternalMapAccessorWithDefaultValue implements Record { @Override public Map<String, Object> asMap() { return Extract.map( this, ofObject() ); } InternalRecord( List<String> keys, Value[] values );  InternalRecord( QueryKeys queryKeys, Value[] values ); @Override List<String> keys(); @Override List<Value> values(); @Override List<Pair<String, Value>> fields(); @Override int index( String key ); @Override boolean containsKey( String key ); @Override Value get( String key ); @Override Value get( int index ); @Override int size(); @Override Map<String, Object> asMap(); @Override Map<String,T> asMap( Function<Value,T> mapper ); @Override String toString(); @Override boolean equals( Object other ); @Override int hashCode();  }
@Test void testAsMap() { InternalRecord record = createRecord(); Map<String,Object> map = record.asMap(); assertThat( map.keySet(), containsInAnyOrder( "k1", "k2" ) ); assertThat( map.get( "k1" ), equalTo( 0L ) ); assertThat( map.get( "k2" ), equalTo( 1L ) ); }