Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright 2012-2015 the original author or authors.
package org.assertj.swing.jide.grids;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Utility methods for tables when using AssertJ-Swing..

Peter Murray
  static void requireSelection(int[] expectedRowsint[] selectedRows) {
    assertEquals("The number of expected selected expectedRows do not match",
    Set<IntegerrequiredRows = new HashSet<Integer>(expectedRows.length);
    for (int row : expectedRows) {
    for (int row : selectedRows) {
      if (!requiredRows.remove(new Integer(row))) {"A row is selected that was not expected to be selected,  " + row);
    assertTrue("There are required row selections that are not selected, ["
               + getContents(requiredRows) + "]",
  static <T extends ObjectString getContents(Collection<T> c) {
    StringBuilder sb = new StringBuilder();
    for (Iterator<T> it = c.iterator(); it.hasNext();) {
      if (it.hasNext()) {
        sb.append(", ");
    return sb.toString();
New to GrepCode? Check out our FAQ X