ValuesHKey extends AbstractValuesHolderRow implements HKey { @Override public void extendWithNull() { int columnIndex = -1; int segment; for (segment = 0; segment < hKeySegments; segment++) { columnIndex += keyDepth[segment]; } for (int i = 0; i < keyDepth[segment-1] && columnIndex < values.size() ; columnIndex++, i++) { valueAt(columnIndex).putNull(); } } ValuesHKey(HKeyRowType rowType, TypesRegistryService registry); @Override boolean equals(Object that); @Override // TODO: This is overkill, but several tests rely upon the older PersistitHKey(key#toString()) behavior, // See ITBase#compareTwoRows(line 190ff). String toString(); @Override int compareTo(HKey o); @Override boolean prefixOf(HKey hKey); @Override int segments(); @Override void useSegments(int segments); @Override void copyTo(HKey target); void copyValueTo(ValueSource value, int columnIndex); @Override void extendWithOrdinal(int ordinal); @Override void extendWithNull(); @Override void copyTo(Key target); @Override void copyFrom(Key source); void copyFrom(byte[] source); byte[] hKeyBytes(); @Override HKey hKey(); Value valueAt(int index); @Override HKey ancestorHKey(Table table); int[] ordinals();  }
@Test public void extendWithNull() { ValuesHKey key = createHKey("customer"); key.valueAt(0).putInt32(42); ValuesHKey target = createHKey("order"); key.copyTo((HKey) target); assertEquals(target.valueAt(0).getInt32(),42); assertEquals(target.segments(), 1); target.extendWithOrdinal(ordinal("order")); assertEquals(target.segments(), 2); target.extendWithNull(); assertTrue (target.valueAt(1).isNull()); }