### Question:
ErrorLookup { public String getLastError() { int lastError = kernel32.GetLastError(); return Arrays.stream(WinError.class.getDeclaredFields()).filter(field -> { try { return Modifier.isStatic(field.getModifiers()) && field.getType() == int.class && field.getName().startsWith("ERROR") && (int) field.get(null) == lastError; } catch (IllegalAccessException e) { return false; } }).map(field -> field.getName() + "(" + lastError + ")") .findFirst() .orElse(Integer.toString(lastError)); } ErrorLookup(Kernel32 kernel32); String getLastError();  }### Answer:
@Test public void testErrorLookupExists() { when(kernel32.GetLastError()).thenReturn(WinError.ERROR_INSUFFICIENT_BUFFER); assertEquals("ERROR_INSUFFICIENT_BUFFER(" + WinError.ERROR_INSUFFICIENT_BUFFER + ")", errorLookup.getLastError()); }
@Test public void testErrorLookupDoesntExist() { when(kernel32.GetLastError()).thenReturn(Integer.MAX_VALUE); assertEquals(Integer.toString(Integer.MAX_VALUE), errorLookup.getLastError()); }