Added test for #1734
Fixed #1734 try resources not final
Fixed test for #1734