@Test public void isCompatibleBothJokers() { Marble joker1 = new Marble(MarbleType.JOKER); Marble joker2 = new Marble(MarbleType.JOKER); assertThat(joker1.isCompatible(joker2)).isTrue(); }
public boolean isCompatible(Marble other) { return other != null && (type.equals(MarbleType.JOKER) || other.type.equals(MarbleType.JOKER) || type.equals(other.type)); }
Marble implements Entity { public boolean isCompatible(Marble other) { return other != null && (type.equals(MarbleType.JOKER) || other.type.equals(MarbleType.JOKER) || type.equals(other.type)); } }
Marble implements Entity { public boolean isCompatible(Marble other) { return other != null && (type.equals(MarbleType.JOKER) || other.type.equals(MarbleType.JOKER) || type.equals(other.type)); } Marble(MarbleType type); }
Marble implements Entity { public boolean isCompatible(Marble other) { return other != null && (type.equals(MarbleType.JOKER) || other.type.equals(MarbleType.JOKER) || type.equals(other.type)); } Marble(MarbleType type); MarbleType getType(); boolean isCompatible(Marble other); }
Marble implements Entity { public boolean isCompatible(Marble other) { return other != null && (type.equals(MarbleType.JOKER) || other.type.equals(MarbleType.JOKER) || type.equals(other.type)); } Marble(MarbleType type); MarbleType getType(); boolean isCompatible(Marble other);  }