class FeatureRecord {

  @Override public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    FeatureRecord record = (FeatureRecord) o;
    return Objects.equals(optionSelectorWeighted, record.optionSelectorWeighted) &&
        Objects.equals(feature, record.feature) &&
        Objects.equals(namespaceFeatureMap, record.namespaceFeatureMap) &&
        Objects.equals(namespaceControlFeatureOptionMap,
            record.namespaceControlFeatureOptionMap) &&
        Objects.equals(namespaceOptionSelectorWeightedMap,
            record.namespaceOptionSelectorWeightedMap) &&
        Objects.equals(controlFeatureOption, record.controlFeatureOption);
  }

}

class FeatureRecordTest {

  @Test
  public void testEquals() {

    final Feature feature = TestSupport.loadFeature(
        "json/feature-select-string-off-default-on-namespace-off-namespace.json");
    final Feature feature1 = TestSupport.loadFeature(
        "json/feature-select-string-off-default-on-namespace-off-namespace.json");
    final Feature feature2 = TestSupport.loadFeature("json/feature-1.json");

    assertEquals(feature, feature1);
    assertNotEquals(feature, feature2);
    assertSame(2, Sets.newHashSet(feature, feature1, feature2).size());
    assertEquals(feature.toString(), feature1.toString());
  }

}