### Question:
ResourceConverterImpl implements ResourceConverter<ResourceType, ClientType> { @SuppressWarnings("unchecked") protected ResourceType getNewResourceInstance() { return (ResourceType) objectFactory.newResource(null, getServerResourceType()); } ResourceConverterImpl(); String getServerResourceType(); @Override ResourceType toServer(ClientType clientObject, ToServerConversionOptions options); @Override ResourceType toServer(ClientType clientObject, ResourceType resultToUpdate, ToServerConversionOptions options); @Override ClientType toClient(ResourceType serverObject, ToClientConversionOptions options); @SuppressWarnings("unchecked") Class<ClientType> getClientTypeClass(); String getClientResourceType();  }### Answer:
@Test public void getNewResourceInstance() { when(converter.getNewResourceInstance()).thenCallRealMethod(); final String expectedResourceTypeName = "testResourceTypeName"; when(converter.getServerResourceType()).thenReturn(expectedResourceTypeName); converter.objectFactory = mock(ResourceFactory.class); final FolderImpl expectedFolder = new FolderImpl(); when(converter.objectFactory.newResource(null, expectedResourceTypeName)).thenReturn(expectedFolder); final Object folder = converter.getNewResourceInstance(); assertSame(folder, expectedFolder); }