Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 538 Bytes

type-inference-using-lombok.md

File metadata and controls

25 lines (16 loc) · 538 Bytes

Type inference using Lombok

Outside of a pretty sketchy looking site Lombok adds loads of great features to Java, who said Java couldn't have type inference?

package com.scalesolved.lombok;

import static org.fest.assertions.Assertions.assertThat;
import lombok.val;

import org.junit.Test;

public class LombokPlayground {

	@Test
	public void shouldUseLombokTypeInference() {
		val admin = new Admin();
		assertThat(admin).isInstanceOf(Admin.class);
	}

	public class Admin {}
}