Code example for Formatter

Methods: closeformat

0
 */ 
public class MockLog implements ILogger { 
    private ArrayList<String> mMessages = new ArrayList<String>();
 
    private void add(String code, String format, Object... args) {
        Formatter formatter = new Formatter();
        mMessages.add(formatter.format(code + format, args).toString());
        formatter.close();
    } 
 
    @Override 
    public void warning(@NonNull String format, Object... args) {
        add("W ", format, args);
    } 
 
    @Override 
    public void info(@NonNull String format, Object... args) {
        add("P ", format, args);
    } 
 
Connect your IDE to all the code out there  Get Codota for Java