Field implements IField { public int getState() { int state = 0; state = setBit(STATE_EXPLODED, state, isExploded); state = setBit(STATE_FLAGGED, state, isFlagged); state = setBit(STATE_OPEN, state, isOpen); state = setBit(STATE_BOMB, state, isBomb); state = setBit(STATE_TOUCHED, state, isTouched); return state; } Field(); private  Field(int state); @Override void addListener(IFieldListener listener); @Override boolean isBomb(); @Override boolean isFlagged(); @Override boolean isOpen(); @Override boolean isExploded(); @Override void removeListener(final IFieldListener listener); @Override boolean isTouched(); void setFlagged(final boolean value); int getState(); static Field createFromState(int state); @Override int getNeighborBombs(); @Override int getImage(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testDefaultState() { assertEquals(0, itsField.getState()); }