Пример #1
0
  /** Tests the {@link Tag#equals(Object)} and the {@link Tag#hashCode()} method. */
  @Test
  public void equalsTest() {
    Tag tag1 = new Tag(KEY, VALUE);
    Tag tag2 = new Tag(KEY, VALUE);
    Tag tag3 = new Tag(KEY, KEY);

    TestUtils.equalsTest(tag1, tag2);

    Assert.assertFalse(tag1.equals(tag3));
    Assert.assertFalse(tag3.equals(tag1));
    Assert.assertFalse(tag1.equals(new Object()));
  }
Пример #2
0
 private Tag getFromSource(Tag sourceTag, Tag expectedTag) {
   for (Tag tag : sourceTag.getTags()) {
     if (tag.equals(expectedTag)) {
       return tag;
     }
   }
   return null;
 }
 public boolean tagMatch(Tag tag) {
   return TAG.equals(tag);
 }