void test() { while (checkCondition()) { somethingElse(); if (checkCondition()) { break; } System.out.println("Text"); } }