IntStream.range(0, width).forEach(x1 -> {
IntStream.range(0, height).forEach(y1 -> {
IntStream.rangeClosed(x1-1, x1+1).forEach(x2 -> {
IntStream.rangeClosed(y1-1, y1+1).forEach(y2 -> {
if ((x1 != x2 || y1 != y2) && getNode(x2, y2) != null){
getNode(x1, y1).registerObserverAtNeighbor(getNode(x2, y2));
}
});
});
});
});