@Test public void testSequenceEquals() { List<Token<AffiliationLabel>> sequence1 = Arrays.asList( new Token<AffiliationLabel>("Bob", 1, 23), new Token<AffiliationLabel>("Hop", 1, 23) ); List<Token<AffiliationLabel>> sequence2 = Arrays.asList( new Token<AffiliationLabel>("bob", 19, 23), new Token<AffiliationLabel>("hoP", 11, 87) ); List<Token<AffiliationLabel>> sequence3 = Arrays.asList( new Token<AffiliationLabel>("Bobb", 1, 23), new Token<AffiliationLabel>("Hop", 1, 23) ); List<Token<AffiliationLabel>> sequence4 = Arrays.asList( new Token<AffiliationLabel>("Bob", 19, 23) ); assertTrue(Token.sequenceTextEquals(sequence1, sequence2, false)); assertFalse(Token.sequenceTextEquals(sequence1, sequence2, true)); assertFalse(Token.sequenceTextEquals(sequence1, sequence3, false)); assertFalse(Token.sequenceTextEquals(sequence1, sequence4, false)); }
@SuppressWarnings("rawtypes") public static <T extends Token> boolean sequenceTextEquals(List<T> lhs, List<T> rhs, boolean caseSensitive) { if (lhs.size() != rhs.size()) { return false; } for (int i = 0; i < lhs.size(); i++) { String lhsString = lhs.get(i).getText(); String rhsString = rhs.get(i).getText(); if (!caseSensitive) { lhsString = lhsString.toLowerCase(Locale.ENGLISH); rhsString = rhsString.toLowerCase(Locale.ENGLISH); } if (!lhsString.equals(rhsString)) { return false; } } return true; }
Token { @SuppressWarnings("rawtypes") public static <T extends Token> boolean sequenceTextEquals(List<T> lhs, List<T> rhs, boolean caseSensitive) { if (lhs.size() != rhs.size()) { return false; } for (int i = 0; i < lhs.size(); i++) { String lhsString = lhs.get(i).getText(); String rhsString = rhs.get(i).getText(); if (!caseSensitive) { lhsString = lhsString.toLowerCase(Locale.ENGLISH); rhsString = rhsString.toLowerCase(Locale.ENGLISH); } if (!lhsString.equals(rhsString)) { return false; } } return true; } }
Token { @SuppressWarnings("rawtypes") public static <T extends Token> boolean sequenceTextEquals(List<T> lhs, List<T> rhs, boolean caseSensitive) { if (lhs.size() != rhs.size()) { return false; } for (int i = 0; i < lhs.size(); i++) { String lhsString = lhs.get(i).getText(); String rhsString = rhs.get(i).getText(); if (!caseSensitive) { lhsString = lhsString.toLowerCase(Locale.ENGLISH); rhsString = rhsString.toLowerCase(Locale.ENGLISH); } if (!lhsString.equals(rhsString)) { return false; } } return true; } Token(String text, int startIndex, int endIndex, L label);  Token(String text, int startIndex, int endIndex);  Token(String text);  Token(); }
Token { @SuppressWarnings("rawtypes") public static <T extends Token> boolean sequenceTextEquals(List<T> lhs, List<T> rhs, boolean caseSensitive) { if (lhs.size() != rhs.size()) { return false; } for (int i = 0; i < lhs.size(); i++) { String lhsString = lhs.get(i).getText(); String rhsString = rhs.get(i).getText(); if (!caseSensitive) { lhsString = lhsString.toLowerCase(Locale.ENGLISH); rhsString = rhsString.toLowerCase(Locale.ENGLISH); } if (!lhsString.equals(rhsString)) { return false; } } return true; } Token(String text, int startIndex, int endIndex, L label);  Token(String text, int startIndex, int endIndex);  Token(String text);  Token(); String getText(); void setText(String text); int getStartIndex(); void setStartIndex(int startIndex); int getEndIndex(); void setEndIndex(int endIndex); L getLabel(); void setLabel(L label); List<String> getFeatures(); void setFeatures(List<String> features); void addFeature(String feature); @Override boolean equals(Object obj); @Override int hashCode(); @SuppressWarnings("rawtypes") static boolean sequenceTextEquals(List<T> lhs, List<T> rhs,
            boolean caseSensitive); @Override String toString(); }
Token { @SuppressWarnings("rawtypes") public static <T extends Token> boolean sequenceTextEquals(List<T> lhs, List<T> rhs, boolean caseSensitive) { if (lhs.size() != rhs.size()) { return false; } for (int i = 0; i < lhs.size(); i++) { String lhsString = lhs.get(i).getText(); String rhsString = rhs.get(i).getText(); if (!caseSensitive) { lhsString = lhsString.toLowerCase(Locale.ENGLISH); rhsString = rhsString.toLowerCase(Locale.ENGLISH); } if (!lhsString.equals(rhsString)) { return false; } } return true; } Token(String text, int startIndex, int endIndex, L label);  Token(String text, int startIndex, int endIndex);  Token(String text);  Token(); String getText(); void setText(String text); int getStartIndex(); void setStartIndex(int startIndex); int getEndIndex(); void setEndIndex(int endIndex); L getLabel(); void setLabel(L label); List<String> getFeatures(); void setFeatures(List<String> features); void addFeature(String feature); @Override boolean equals(Object obj); @Override int hashCode(); @SuppressWarnings("rawtypes") static boolean sequenceTextEquals(List<T> lhs, List<T> rhs,
            boolean caseSensitive); @Override String toString();  }