EntityRecordWithColumns implements WithLifecycle { public static EntityRecordWithColumns of(EntityRecord record) { return new EntityRecordWithColumns(record, Collections.emptyMap()); } private  EntityRecordWithColumns(EntityRecord record, Map<ColumnName, Object> storageFields); static EntityRecordWithColumns create(EntityRecord record,
                                                 Entity<?, ?> entity,
                                                 RecordStorage<?> recordStorage); static EntityRecordWithColumns of(EntityRecord record); @VisibleForTesting static EntityRecordWithColumns of(EntityRecord record, Map<ColumnName, Object> storageFields); EntityRecord record(); ImmutableSet<ColumnName> columnNames(); @Nullable Object columnValue(ColumnName columnName); R columnValue(ColumnName columnName, ColumnMapping<R> columnMapping); boolean hasColumns(); @SuppressWarnings("BooleanMethodIsAlwaysInverted") boolean hasColumn(ColumnName name); @Override LifecycleFlags getLifecycleFlags(); @Override boolean isArchived(); @Override boolean isDeleted(); @Override boolean isActive(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test @DisplayName("support equality") void supportEquality() { ColumnName columnName = ColumnName.of(archived.name()); Object value = false; EntityRecordWithColumns emptyFieldsEnvelope = EntityRecordWithColumns.of( EntityRecord.getDefaultInstance(), Collections.emptyMap() ); EntityRecordWithColumns notEmptyFieldsEnvelope = EntityRecordWithColumns.of( EntityRecord.getDefaultInstance(), singletonMap(columnName, value) ); new EqualsTester() .addEqualityGroup(emptyFieldsEnvelope, notEmptyFieldsEnvelope) .addEqualityGroup(newRecord()) .addEqualityGroup(newRecord()) .testEquals(); }