protected List<TokenBean> sumUnknownInTokenList(List<TokenBean> listtosum,List<IToken> types) {
List<TokenBean> newlist= new ArrayList<TokenBean>();
for(int i=0;i<listtosum.size();i++){
TokenBean current = listtosum.get(i);
if(isTokenInList(current.getToken(), types)){
int sumTokenLenght=0;
int j=i;
TokenBean next = null;
if (i < listtosum.size()-1) {
next = listtosum.get(i+1);
}
while(next != null && equals(current.getToken(), next.getToken())){
sumTokenLenght+=current.getLength();
j++;
current = listtosum.get(j);
if (j < listtosum.size() - 1) {
next = listtosum.get(j+1);
} else {
next = null;
}
}
TokenBean tokenAtSummingStart = listtosum.get(i);
TokenBean newTokenBean = new TokenBean();
newTokenBean.setToken(tokenAtSummingStart.getToken(), sumTokenLenght+current.getLength(), tokenAtSummingStart.getOffset());
newlist.add(newTokenBean);
i=j;
}
else{
newlist.add(current);