InternalRecord extends InternalMapAccessorWithDefaultValue implements Record { @Override public List<String> keys() { return queryKeys.keys(); } 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 shouldHaveMethodToGetKeys() { List<String> keys = Arrays.asList( "k2", "k1" ); InternalRecord record = new InternalRecord( keys, new Value[]{value( 0 ), value( 1 )} ); List<String> appendedKeys = record.keys(); assertThat( appendedKeys, equalTo( keys ) ); }
@Test void emptyKeysShouldGiveEmptyList() { List<String> keys = Collections.emptyList(); InternalRecord record = new InternalRecord( keys, new Value[]{} ); List<String> appendedKeys = record.keys(); assertThat( appendedKeys, equalTo( keys ) ); }