About Indentation on Java
===

I'm about to get my first work as a programmer, and I was practicing some String manipulation when I realized my code was getting really ugly (specially when nesting conditions).

Question: Do you think the following code violates any good practices? If yes: How would you make it cleaner? 

	public String Compress(String input){
		int counter = 1;
		char lastChar = input.charAt(0);
		StringBuilder sb = new StringBuilder();

		for (int i = 1; i<input.length(); i++){
			if (input.charAt(i) == lastChar){ 
				counter++;
			}else{
				if(counter>1){ sb.append(counter+""+lastChar); }
				else{ sb.append(lastChar); }

				counter = 1;
				lastChar = input.charAt(i);
			}
		}

		if (counter>1){ sb.append(+counter+""+lastChar); }
		else{ sb.append(lastChar); }

		return sb.toString();
	}

}


Thanks in advance, any tips on conventions are greatly appreciated.
