package net.raboof.leftpad;

import java.util.function.Function;

public class LeftPad implements Function<CharSequence, String> {
    private final int length;
    private final char fill;

    public LeftPad(int length, char fill) {
        this.length = length;
        this.fill = fill;
    }

    public LeftPad(int length) {
        this(length, ' ');
    }

    public String apply(CharSequence s) {
        StringBuilder builder = new StringBuilder();

        int i = -1;

        int len = length- s.length();

        while (++i < len) {
            builder.append(fill);
        }

        builder.append(s);

        return builder.toString();
    }
}

@@ -395,17 +395,27 @@
 equence 
-s
+inputString
 ) %7B%0A    
@@ -432,23 +432,22 @@
 Builder 
-builder
+output
  = new S
@@ -512,11 +512,22 @@
 ngth
+ 
 - 
-s
+inputString
 .len
@@ -553,11 +553,11 @@
 le (
+i
 ++
-i
  %3C l
@@ -566,39 +566,38 @@
 ) %7B%0A            
-builder
+output
 .append(fill);%0A 
@@ -618,23 +618,22 @@
     
-builder
+output
 .append(
 s);%0A
@@ -628,17 +628,27 @@
 .append(
-s
+inputString
 );%0A%0A    
@@ -662,15 +662,14 @@
 urn 
-builder
+output
 .toS

fix code style