Instance of an Interface (Java)
It looks like “instance” an Interface…
import static org.junit.Assert.assertTrue; import org.junit.Test; public class InterestingTests { [cite/t:@Test] public void TestConstructInterface() { TurnstileController controller = new TurnstileController() { private boolean lockState = false; private boolean unlockState = false; public void lock() { lockState = true; } public void unlock() { unlockState = true; } public boolean isLockState() { return lockState; } public boolean isUnlockState() { return unlockState; } }; controller.lock(); assertTrue(controller.isLockState()); controller.unlock(); assertTrue(controller.isUnlockState()); } private interface TurnstileController { public void lock(); public void unlock(); public boolean isLockState(); public boolean isUnlockState(); }; }