public static Pair<Type,List<ArrayBracketPair>> unwrapArrayTypes(Type type){
  final List<ArrayBracketPair> arrayBracketPairs=new ArrayList<>();
  while (type instanceof ArrayType) {
    ArrayType arrayType=(ArrayType)type;
    arrayBracketPairs.add(new ArrayBracketPair(Range.UNKNOWN,arrayType.getAnnotations()));
    type=arrayType.getComponentType();
  }
  return new Pair<>(type,arrayBracketPairs);
}

public static Pair < Type , List < ArrayBracketPair > > unwrapArrayTypes ( Type type ) { final List < ArrayBracketPair > arrayBracketPairs = new ArrayList < > ( ) ; while ( type instanceof ArrayType ) { ArrayType arrayType = ( ArrayType ) type ; arrayBracketPairs . add ( new ArrayBracketPair ( Range . UNKNOWN , arrayType . getAnnotations ( ) ) ) ; type = arrayType . getComponentType ( ) ; } return new Pair < > ( type , arrayBracketPairs ) ; }
takes a type that may be an arraytype . unwraps arraytypes until the element type is found .
