Print all path lenghts and their counts .
for ( Map . Entry < Integer , Integer > entry : m . entrySet ( ) ) { System . out . printf ( "%d paths have length %dNEW_LINE", entry . getValue ( ) , entry . getKey ( ) ) ; } }