Avoid using java7 specific api