@Test public void unbox() throws Exception { assertThat(TypeName.INT).isEqualTo(TypeName.INT.unbox()); assertThat(TypeName.VOID).isEqualTo(TypeName.VOID.unbox()); assertThat(ClassName.get(Integer.class).unbox()).isEqualTo(TypeName.INT.unbox()); assertThat(ClassName.get(Void.class).unbox()).isEqualTo(TypeName.VOID.unbox()); try { TypeName.OBJECT.unbox(); fail(); } catch (UnsupportedOperationException expected) { } try { ClassName.get(String.class).unbox(); fail(); } catch (UnsupportedOperationException expected) { } }