Tag Archives: Java

Using Matches for null parameter with Mockito

I was using Mockito to write a unit test today and had a brief struggle trying to write a Matcher for a parameter I expected to be null. Here is the method in my interface that was causing problems: public … Continue reading

Posted in Java, Mockito | Tagged , | Leave a comment

FindBugs warning with Guava’s Predicate interface

When running FindBugs on some code I wrote, I received a  NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE warning: Bug type NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE (click for details) In class com.wall.steve.HelperMethods$1 In method com.wall.steve.HelperMethods$1.apply(MyItem) Parameter item At HelperMethods.java:[line 27] This was the code I had written: //com.wall.steve.HelperMethods class public static … Continue reading

Posted in Guava, Java | Tagged , | Leave a comment

My Presentation at the Twin Cities Java User Group

This week I gave a presentation titled “What’s New in Java 8” at the November meeting of the Twin Cities Java User Group (TCJUG). Topics covered include: Interfaces – static and default methods Lambdas Functional Programming Streams API New java.time … Continue reading

Posted in Java, Java 8 | Tagged , | Leave a comment

Java 8 Streams.max() and Streams.min() example

I have been playing around with the new Stream interface in Java 8 and struggled briefly with the max() and min() methods.  Here is some example code I wrote for how to use the method max() from the Stream class.  The min() … Continue reading

Posted in Java, Java 8 | Tagged , | 3 Comments

Eclipse Error: project facet java 1.7 is not supported by target runtime apache tomcat v6.0

We are upgrading some Java Projects from Java 6 to Java 7.  We use Eclipse yet still need to use Apache Tomcat 6.0.x.  After downloading and installing the a JDK 7 and changing all the necessary references in Project Preferences to Java … Continue reading

Posted in Java, Tomcat | Tagged , , | 3 Comments