Can someone explain to me the use of those brakets? I'm not sure if it's related to the Map or iterator declaration so that's why im putting it there, maybe it does maybe it doesn't
That doesn't look like an inner class and that doesn't look like an if/else statement, so what is it and why would someone want to use it.
The only advantage that this style could have is what Fred already mentions: any variables that you declare inside the block go out of scope when the block ends, so you could use this to control the scope of the variables. However, using braces just for this purpose is not something that is commonly done in Java. I would avoid this style of programming. It is probably better to put the whole block in a separate method and call that method instead.
Better: Put the block in its own method.
Even better, but not the point of this topic: Use foreach style for-loops.