@Test
public void compatibleWith() {

    final RecordStoreState empty = stateOf();
    final RecordStoreState oneWriteOnly = stateOf("one", IndexState.WRITE_ONLY);
    final RecordStoreState oneDisabled = stateOf("one", IndexState.DISABLED);
    final RecordStoreState hasBoth = stateOf("one", IndexState.WRITE_ONLY, "two", IndexState.DISABLED);
    assertTrue(empty.compatibleWith(oneWriteOnly));
    assertFalse(oneWriteOnly.compatibleWith(empty));
    assertTrue(empty.compatibleWith(oneDisabled));
    assertFalse(oneDisabled.compatibleWith(empty));
    assertTrue(empty.compatibleWith(hasBoth));
    assertFalse(hasBoth.compatibleWith(empty));
    assertTrue(oneDisabled.compatibleWith(oneWriteOnly));
    assertTrue(oneWriteOnly.compatibleWith(oneDisabled));
    assertTrue(oneWriteOnly.compatibleWith(hasBoth));
    assertFalse(hasBoth.compatibleWith(oneWriteOnly));
    assertTrue(oneDisabled.compatibleWith(hasBoth));
    assertFalse(hasBoth.compatibleWith(oneDisabled));
}