Here is half of the first one. It does not contain the second 'for' loop or the return statement (which I gave above):
private List<Tile> getHorizontalMatchingTiles(int x, int y)
{
List<Tile> list = new ArrayList();
list.add(getObjectsAt(x, y, Tile.class));
Class cls = list.get(0).getClass();
for (int n=1; n<3 && x-n >= 0; n++)
{
Tile tile = (Tile)getObjectsAt(x-n, y, Tile.class).get(0);
if (tile.getClass() == cls) list.add(tile); else break;
}
