The problem with a longer ship is not the berths, but the size of the swinging area in the port. Most ports have geographical constraints and will be unable to accommodate larger vessels without a huge added cost of additional channel widening to create areas where these vessels could be swung.
I am not convinced that these 18000teu vessels need to be longer than 400 metres. Afterall, they will be 24 boxes across where the E class are 22 and their hull will be more "box" like as per the MSC Daniella class. The E class can, and has actually loaded just over 15000teu.
Using MSC Daniella as an example at 13500teu and building from that, she is 20 boxes across and 44 x 20' bays long. By widening her to 24 boxes across at 7 high on deck and 10 high below deck = 44 x 4 x 17 = 2992. That increases teu to 16492. By now increasing the length by 2 x 40' bays, ie 4 x 20' bays, which brings her to about 400m long the capacity is incresed by 4 x 24 x 17 = 1632, which gives a total 18124 teu. Take off 124 boxes for good measure and that gives you an 18000teu 400m long ship.
Another point to note is that when Maersk builds their own ships in their own yard, they are very secretive about the sizes etc, but when another yard is building them for maersk, the yard wants the publicity that they are building the first of the next generation, so they sing loadly about the actual capacity of the ship.