@SuppressWarnings("SimplifiableJUnitAssertion") @Test public void testEquals() { Id id1 = new Id("012345678901234"); Id id2 = new Id("012345678901234567"); assertTrue(id1.equals(id2)); assertTrue(id2.equals(id1)); }
@Override public boolean equals(Object other) { if (other instanceof Id) { return this.getIdStr().equals(((Id) other).getIdStr()); } return false; }
Id { @Override public boolean equals(Object other) { if (other instanceof Id) { return this.getIdStr().equals(((Id) other).getIdStr()); } return false; } }
Id { @Override public boolean equals(Object other) { if (other instanceof Id) { return this.getIdStr().equals(((Id) other).getIdStr()); } return false; } Id(@Nonnull String id); }
Id { @Override public boolean equals(Object other) { if (other instanceof Id) { return this.getIdStr().equals(((Id) other).getIdStr()); } return false; } Id(@Nonnull String id); @Nonnull String getKeyPrefix(); @Nonnull String getFullId(); @Nonnull String getIdStr(); @Override @Nonnull String toString(); @Override boolean equals(Object other); @Override int hashCode(); }
Id { @Override public boolean equals(Object other) { if (other instanceof Id) { return this.getIdStr().equals(((Id) other).getIdStr()); } return false; } Id(@Nonnull String id); @Nonnull String getKeyPrefix(); @Nonnull String getFullId(); @Nonnull String getIdStr(); @Override @Nonnull String toString(); @Override boolean equals(Object other); @Override int hashCode();  }