void () { String text = String.format("this is a test text with two inline meta-datas: {@%s meta \t text} and {@%s}", META_KEY, META_KEY); myMockery.checking(new Expectations() {{ one(myProcessor).process("meta \t text"); will(returnValue(new JLabel(""))); one(myProcessor).process(""); will(returnValue(new JLabel(""))); }}); myBuilder.setText(text); }