There was once a small city with only a few people in it. And a powerful king came against it, surrounded it and built huge siege works against it.
Some time later, Ben-Hadad king of Aram mobilized his entire army and marched up and laid siege to Samaria.
I also saw under the sun this example of wisdom that greatly impressed me:
The days will come upon you when your enemies will build an embankment against you and encircle you and hem you in on every side.
However, you may cut down trees that you know are not fruit trees and use them to build siege works until the city at war with you falls.