2

I'm currently doing a whole new project and writing some utilities such as StringUtil.java.

I have a private constructor like below.

public class StringUtil {

  // TODO Exclude this from measuring test coverage
  private StringUtil() { }

  public static boolean isEqual(String a, String b){
     return true;
  }     
}

After doing Run test... with Coverage in android studio, I got my coverage which is not 100%. Because the private Constructor is not called.

Is there any workaround to exclude private constructor from measuring test coverage(without calling it, indeed)?

Hello world
  • 353
  • 3
  • 18
  • ["Dont' let the tool be in charge of you"](http://stackoverflow.com/a/4520241/2754160) – h.j.k. May 25 '15 at 13:43
  • 1
    @h.j.k. Thanks for the valuable opinion. Still it seems little bit controversial though. I'll have a conversation with my team as well. Thanks again. – Hello world May 26 '15 at 14:55

0 Answers0