### Question:
StopWatch { static void appendRightAlignedNumber(StringBuilder theStringBuilder, String thePrefix, int theNumberOfDigits, long theValueToAppend) { theStringBuilder.append(thePrefix); if (theNumberOfDigits > 1) { int pad = (theNumberOfDigits - 1); for (long xa = theValueToAppend; xa > 9 && pad > 0; xa /= 10) { pad--; } for (int xa = 0; xa < pad; xa++) { theStringBuilder.append('0'); } } theStringBuilder.append(theValueToAppend); } StopWatch();  StopWatch(Date theStart);  StopWatch(long theStart); void endCurrentTask(); String formatMillisPerOperation(long theNumOperations); String formatTaskDurations(); String formatThroughput(long theNumOperations, TimeUnit theUnit); String getEstimatedTimeRemaining(double theCompleteToDate, double theTotal); long getMillis(Date theNow); long getMillis(); long getMillisAndRestart(); long getMillisPerOperation(long theNumOperations); Date getStartedDate(); double getThroughput(long theNumOperations, TimeUnit theUnit); void restart(); void startTask(String theTaskName); @Override String toString(); static String formatMillis(long theMillis); static String formatMillis(double theMillis);  }### Answer:
@Test public void testAppendRightAlignedNumber() { StringBuilder b= new StringBuilder(); b.setLength(0); StopWatch.appendRightAlignedNumber(b, "PFX", 0, 100); assertEquals("PFX100", b.toString()); b.setLength(0); StopWatch.appendRightAlignedNumber(b, "PFX", 1, 100); assertEquals("PFX100", b.toString()); b.setLength(0); StopWatch.appendRightAlignedNumber(b, "PFX", 2, 100); assertEquals("PFX100", b.toString()); b.setLength(0); StopWatch.appendRightAlignedNumber(b, "PFX", 3, 100); assertEquals("PFX100", b.toString()); b.setLength(0); StopWatch.appendRightAlignedNumber(b, "PFX", 4, 100); assertEquals("PFX0100", b.toString()); b.setLength(0); StopWatch.appendRightAlignedNumber(b, "PFX", 10, 100); assertEquals("PFX0000000100", b.toString()); }